![]() Orders could contain simple products without any wrapping, as well as boxes stuffed with products.and other boxes. Say you decide to create an ordering system that uses these classes. These little Boxes can also hold some Products or even smaller Boxes, and so on. ![]() A Box can contain several Products as well as a number of smaller Boxes. ![]() Using the Composite pattern makes sense only when the core model of your app can be represented as a tree.įor example, imagine that you have two types of objects: Products and Boxes.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |