What extensibility design patterns are there and what are their pros and cons?
I'm working on a new CMS system and I want it's core开发者_JAVA技巧 to be extended or overwritten for specific customers. The information out there is sparse, or I haven't been looking good enough, but I want hands-on experience from fellow developers.
What probably you are looking for when designing a CMS is how pluggable it is. Are your extension points well conceived and thought of. Check out following links for the extensibility aspect
- Pluggable Architecture
- Architecture & Design
For the design aspect standard patterns like Open/Close Principle, Interface Segregation Principle should help.
Ultimately its about how much pluggable your CMS is and how much effort your consumers of core CMS have to put in to add the new components. You may also find this stackoverflow thread useful.
To start with it sounds complex. However, IMO it can be achieved by simply following the basics. While you develop your framework you should have strong focus on following -
Strive for modular design - Always code to interfaces, favor composition over inheritance etc.
Write Unit Tests for all code - This is very important as tests will not only guide you towards loosely coupled design but also will prove important in verifying backward compatibility, which is an important issue in such projects.
Build only what is needed and avoid too much upfront design and over-designing - Note that frameworks are best extracted from code rather than built up-front. In such projects it is very easy to get carried away and build something that is not needed. Unwanted features will not only waste time and money but will also make it difficult to make future changes. Don't do too much upfront design and build things in small iterations, refactor often and use unit-tests as your safety net.
精彩评论