So You’re Going to Make a Framework?
Don’t.
Seriously don’t just make a framework.
Here’s why your framework will fail:
- You don’t know what the future requirements are, so you’ll provide too little
- You don’t know what the future requirements are, so you’ll provide too much
- You’ve not encountered the general case of what you’re trying to make, so you’ll end up too specific
- You’ve not focused on your specific use cases enough, so your framework will be so general, it can’t be easily specialised
In general, and I can generalise because I’ve made this mistake before (lots), if you set out to make a framework, you’re quite likely to fail unless this is the third or fourth attempt at solving a problem you’re very experienced at solving in the same context.
Then how come we have frameworks?
Great frameworks are extracted from great specialist software, or are extracted from great experience, or are evolved and rewritten until they become useful.
If you’re thinking you may one day need a framework, then start out as such:
- Find the least amount of technology…
- … and the fewest specific requirements…
- … and make a concrete implementation using something that already exists
Review your solution and ask about the next 10 or 20 features. How will it scale to support them? You will either decide to:
- Extend it some more
- Refactor it to support extension and then extend it
- Extract a clear general case and reuse that
Rinse and repeat a couple of times and you’ll either have a framework, or have adopted something that suits your needs and doesn’t need one of your own devising.
Published on Java Code Geeks with permission by Ashley Frieze, partner at our JCG program. See the original article here: So You’re Going to Make a Framework? Opinions expressed by Java Code Geeks contributors are their own. |