samedi 5 décembre 2015

Extendable and efficient solution

There is a Room class. It contains list of furniture; chairs, table & etc. It is required to retrieve list of chairs only. Keeping separate list for each types of furniture is not an extendable solution. (For example adding a new furniture type requires new type of list creation & so on.) But having a single list and updating it requires to iterate through all the furniture and find out the chairs only with the help of instance of operator or any other ways.

How to design such an implementation efficiently with design pattern or data-structure?

Aucun commentaire:

Enregistrer un commentaire