Appendix A — Sample pseudocode (component aggregation)