On agile projects, we know that the software design is not done from the front but from the back. In other words, some software product features are developed when the customer wants to add them to existing software product. Software design for these software product features were never made before and only after the project team is asked to develop these software product features that the project team develops a design for these features. The existing software product already has its own software design. Now the project team has to create software design for the new product features which need to be developed.
The software design for the new software features also need to be integrated with the design of the existing software product. This is a real challenge because the new design part may not align well with the existing design. For example suppose you have a software product for restaurant order management system. Currently it has a class for selecting a menu. Currently there are some 4 types of menus (chicken, beef, vegetarian, Chinese). The new product features require the menus to expand to include 10 types of menus (Japanese, Indian etc.).
Since so many types of menus are there now, the business logic will become very complicated. You will have to write many switch or if – else statements. Designing such a piece of feature will be cumbersome. This may also result in software defects. In this scenario, it will be better to have sub-classes for each type of menu. Restructuring the menu class and creating many sub-classes dealing exclusively with each type of menu will be a better software design.
For changing the existing software design to incorporate the new software features, you will have to do a lot of work. But this work will pay off in the long run. Now if more new menus need to be added in the software product, you only have to create new sub-classes. These sub-classes will be very similar to existing sub-classes. So you can reuse much of the existing code. This design will also be easy to maintain.