In the old days of programming era, the main tools for developing applications were a programming language compiler, very small set of libraries and the operating system API(s) – these were powerful yet very basic set of low-level programming tools. As a developer – they were discovering an increasing amount of code that was repetitive and could be abstracted away with the aid of higher-level API(s). We then moved and embraced the features of Object-Oriented programming, this gave us more flexibility, and an emphasis on extensibility and reusability. This thought process kicked of a revolutionary concept which we call today as Frameworks.
When higher-level API are built with the idea of reusability we mostly say, that we are building/working with Frameworks. Now creating frameworks is never an easy task, there are a lot of guidelines and best practices, we are supposed to follow or at least keep in mind to develop a well-designed framework. In other word, a well-designed framework are the ones that are self-consistent.
There are many factors, such as performance, reliability, security, dependency management and so on that in fact affect software quality. Frameworks, of course must adhere to these same quality standards. The main and important difference between frameworks and other kind of software is that frameworks are made up of reusable APIs, which represents a set of special considerations in designing quality frameworks. Let’s see what are the qualities of a well-designed framework –
Well Designed Frameworks are Simple –
Most frameworks do not lack power because more features are reasonably easy to add as requirements become clearer. On the other hand, simplicity often gets sacrificed when schedule-pressure, feature creep or the desire to satisfy every little corner case scenario takes over the development process. However, simplicity is a must have feature of every framework. While designing if you have any second thoughts about the complexity of a design, it is almost always much better to cut that feature from the current release and spend more time on it to get the design right for the next release. As a thumb rule – “you can always add; you cannot ever remove”.
Well Designed Frameworks borrow from past –
Most successful framework borrow from and build on top of existing proven designs. It is possible and often desirable to introduce completely novel solutions into framework design but it should be done with utmost caution. You should always make the API to your library as boring as possible, of course you want the functionality to be interesting not the API.
Well Designed Frameworks are Consistent –
Consistency is the key characteristics of well-designed framework. It is one of the most important factors affecting productivity. A consistent framework allows for transfer of knowledge between parts of the framework that a developer know to the art and that the developer is trying to learn. Consistency also helps developers to quickly recognize which parts of the design are unique to a particular feature area and so require special attention to work with and probably which are the just the same old common design patterns.
Well Designed Frameworks are Integrated –
Modern frameworks need to be designed to integrate well with a large ecosystem of different development tools, programming languages, applications etc. We are so much into Distributed Computing these days and we all are well aware that this means that frameworks designed for a specific application model are of no use.
Well Designed Frameworks are full of Trade-Offs-
There is no such things as the perfect design. Design is all about making trade-offs and to make the right decision, you need to understand options and their benefits and their drawbacks. If you ever find yourself thinking you have a design without trade-offs, you are probably missing something big instead of finding the silver bullet.
Well Designed Frameworks are designed to Evolve –
While designing any framework, on the one hand, you can certainly take more time and give more efforts in the design proves and occasionally additional complexity can be introduced “just in case”. But on the other hand, careful consideration can also save you from delivering something that will degrade over time or even something that will not be able to preserve backward compatibility. As a thumb rule – it is better to move a complete feature to the next release than to do it halfway in the current release.
And last but the not the least –
Well Designed Frameworks are Expensive to Design –
Good framework design does not happen magically. It is hard work that consumes lots of time and resources. Framework design should be an explicit and distinct part of the development process, it must be explicit because it needs to be appropriately planned, staffed and executed and it must be distinct because it cannot just be a side effect of the implementation process.
Moreover, best framework design are done either by people whose explicit responsibility is framework design, or by those who can put the framework designer’s hat on the right time in the development process. Mixing the development process and framework design is a big mistake.