Click here to Skip to main content
15,890,378 members
Articles / All Topics

Should You Really Create Your Own Framework?

Rate me:
Please Sign up or sign in to vote.
5.00/5 (1 vote)
14 Oct 2010CPOL3 min read 13.9K   5   3
The distinction between using a readily available 3rd party framework and creating your own.

In this post, I'm going to talk about the distinction between using a readily available 3rd party framework and creating your own. Creating your own framework brings with it a whole set of considerations.

Firstly, I’ll explain what I mean by a framework. A framework is a way of abstracting code, it wraps up the underlying complexities into something that should be easier to use.

The following are often true of 3rd party frameworks specifically created for others to use:

  • They are used by a large number of developers and organizations.
  • They are typically well documented.
  • They are well maintained.

Taking the decision as to whether or not to use a framework is a big decision in itself. The question that then arises is which framework you should use. Is there already one out there which does what you want? Should you create your own?

Most developers are used to using frameworks of one sort or another. For example, NHibernate and the Entity Framework are both used to make data access easier and faster. Sometimes though, a third party framework may not exist that meets your needs or that fits with your application. Although you wouldn't typically attempt to create a framework the size of the aforementioned, you may decide to create a framework to meet a particular need.

Creating your own magnifies some of the factors you need to think about when using a third party framework. You have to be very clear about what it should do. You need to be careful about not making the problem you are trying to solve worse. You are creating it to make development easier, but it’s easy to end up with a framework that is inflexible and has a steep learning curve. You then find that you're restricting the functionality that can be added to the software, i.e., it doesn’t support what the product manager is asking for. You find yourself in the position where something that would be quick to achieve without a framework is very difficult with one. You then have to either modify the framework (which can be difficult, especially if a lot of code relies on it) or bypass the framework (which defeats the point of creating it in the first place).

Another problem is that new developers have to learn a new framework – this is of course made more difficult if you didn’t document how it works.

In fact, the above in my view is the key distinction between using a 3rd party framework and creating one yourself. It’s difficult to expect a new developer to quickly pick up a poorly documented framework which they will only ever use at that one company. Try explaining to a new developer why they have to learn a framework instead of just writing the underlying code (what chances are they know how to do).

Having said this though, I've found that writing your own framework can be very rewarding and you certainly have full control over it. If it serves a clear purpose, solves a real problem, works well, is flexible, and is well documented, then it’s likely to be successful. Achieving this though is easier said than done.

(14/10/2010 - Edited based on feedback).

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
United Kingdom United Kingdom
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions

 
QuestionWhat do you mean with ... Pin
Reinhard Ostermeier14-Oct-10 4:17
Reinhard Ostermeier14-Oct-10 4:17 
AnswerRe: What do you mean with ... Pin
Caprica114-Oct-10 4:38
Caprica114-Oct-10 4:38 
GeneralRe: What do you mean with ... Pin
Reinhard Ostermeier14-Oct-10 5:37
Reinhard Ostermeier14-Oct-10 5:37 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.