educative.io

Searching the room in the inventory

How will searching the inventory work?
Don’t we need a separate class which stores the rooms mapping wrt to different style?

Yes we will need an inventory class where we will have some maps of all the Room class objects. That has to be there because room class can not return a list of all room objects. Inventory class will implement search interface and room will have 1 to many relationship with inventory. To get an idea you can refer Library Management system design.

3 Likes

I think the class diagram now is missing this catalog class which should actually implement the search room interface