开发者

What extensibility design patterns are there and what are their pros and cons?

开发者 https://www.devze.com 2023-02-15 21:35 出处:网络
I\'m working on a new CMS system and I want it\'s core开发者_JAVA技巧 to be extended or overwritten for specific customers.

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

  1. Pluggable Architecture
  2. 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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号