Favor composition over inheritance.

Master and Student…

Master: Grasshopper, tell me what you have learned of the Object-Oriented ways.

Student: Master, I have learned that the promise of the object-oriented way is reuse.

Master: Grasshopper, continue…

Student: Master, through inheritance all good things may be reused and so we come to drastically cut development time like we swiftly cut bamboo in the woods.

Master: Grasshopper, is more time spent on code before or after development is complete?

Student: The answer is after, Master. We always spend more time maintaining and changing software than on initial development.

Master: So Grasshopper, should effort go into reuse above maintainability and extensibility?

Student: Master, I believe that there is truth in this.

Master: I can see that you still have much to learn. I would like for you to go and meditate on inheritance further. As you’ve seen, inheritance has its problems, and there are other ways of achieving reuse.


This quote comes from Head First Design Patterns, I personally favor composition over inheritance.

The Strategy Pattern defines a family of algorithms, encapsulates each one, and makes them interchangeable. Strategy lets the algorithm vary independently from clients that use it.

A Review of Data-Driven Architecture with RESTful APIs

In computer programming processes, Application Programming Interfaces (APIs) refer to sets of tools, protocols and routines from which software applications are built. The APIs express software components in terms of output, input, underlying type, and operations. Therefore, APIs aid in defining functionalities independent of particular representations. This process allows the implementations and definitions to vary (while ensuring that interfaces are not compromised). Indeed, good APIs make it easier for individuals to develop programs by offering the required building blocks, upon which programmers put the blocks together (Haupt et al., 2014, 3). On the other hand, Representational State Transfer (REST) constitutes a style through which software architecture operates on distributed systems. One of the distributed systems is the World Wide Web in which the REST design model has emerged predominantly (Perez et al., 2011, 283).

Read more