Deep
BAN USERThink This model as n-ary tree or compositite design pattern Room is the leaf node and City, Building, Floor are the composite structure.
To add the feature like capacity and tell weather this room is confrence or not use the decorator pattern to make the room dynamically conference or not.
To start a conference, use the iterator pattern to find out the room to connect.
To talk about the HLD use n*n multicast the packet over the wires.
Designing should be in such a way the client code should not be changed at all, for viewing items, selling items, adding inventory to the store. etc To work out these stuff:-
Define a interface as Inventory.
Start defining the composite object like Furniture Item, Electronics Item etc.
Under these add the Concrete Implementation like chair, table, telephone.
Just think in term of composition under each category,
To add the property at the run time isChildSafe, IsWaterSafe use decorator design pattern.
To iterate to all of the inventory, to sell , view use iterator design pattern.
When doing the iteration, different kind of objects are there use visitor design pattern to execute different algorithms on it.
File system could be a directory or file use composite design pattern. There can be various kind of file, do not create various file, add these properties on run time, for this use decorator pattern. To traverse the file system use the iterator design pattern. There could be multiple types of traversal scheme, provide the root to the different iterator implementation
- Deep June 04, 2017
can you please elaborate more in details
- Deep May 13, 2018