At the end of Lesson 7, "Creating Components with MXML," you were left with a bad practice, having the CategorizedProductManager component reach into its parent document to inform the parent that the category data has been loaded. This created a tightly coupled application, in that the CategorizedProductManager component can work only if it knows the parent has a certain method. A far better practiceand better object-oriented designis to use a loosely coupled architecture that is made possible by using events to notify other components of changes instead of requiring components to know information about the rest of the application. With a loosely coupled architecture like this, components can be reused across multiple applications without requiring a particular structure to the applications. |