I have an exercise to design and implement a system for furniture. Each furniture has different attributes such as manufacturer, type (chair, sofa,) etc. and each furniture has a concrete class, for example RobertoSofa. Each furniture has getAttributes function that returns all of its attributes.
The requirements are:
- Use design patterns
- If someone in the future will want to add a new attribute there should be no change in the existing code.
My thoughts are using Db for attributes so my code will not change, but is there a design pattern I can use instead?? Thanks!
Aucun commentaire:
Enregistrer un commentaire