Adaptive Programming is a development method that is built on the Law of Demeter principle. The feature of loose coupling makes the software programs more flexible and resilient to change.
For Current Development Processes
The rigid Waterfall model has been given up by lot of software houses for development. New ideas based on evolutionary software development methodologies like spiral development or Rational Unified Process (RUP) have proved to be better for ever-changing real world businesses. This means that technically lot of class structures evolve over iterations or phases, impacting the code that depends on the class structure. Adaptive Programming enables knowing minimum about class structures of the objects that the code uses, reducing the probability and the amount of change required.
To be able to do this, the problem that has to be solved should be abstracted into a more general problem. This abstraction is not the programming abstraction, but abstraction to arrive at a general definition of the problem. Write a general program and split it into loosely coupled building blocks so that their interdependence reduces. Lets look at certain patterns defined for Adaptive Programming.
Adaptive Programming Patterns
Adaptive Programming has been applied in multiple domains, and certain patterns have been formulated to identify the key elements and elaborate on them.
- Inventor’s Paradox
Solve a concrete problem by solving a more general problem. The general problem has paradoxically a simpler solution. But you have to invent an appropriate general problem which covers your concrete problem.
- Structure-shy Traversal
Structure-shy Traversal gathers the code describing the traversal
in one place with minimal dependency on the class structure.
Commit only to a navigation strategy and specify navigation details
- Structure-shy Object
During evolution of an application class structures frequently change
which implies updates to application objects. There is a strong need
to use object representations which are robust under class structure changes.
Loosely couple behavior modification to behavior and structure. Write an editing program instead of editing the program yourself. Reuse editing program later. Define collaborative behavior modification in one place instead of spreading it over the program. Context let’s you write behavior modifications with minimal dependency on the class structure.
- Class Graph
To make your application more robust to changes in class structure,
automate the definition of class graph induced operations such as
copying, displaying, printing, checking etc.
Relation to Aspect Oriented Programming
Adaptive Programming and Aspect Oriented Programming are related to each other. Some Adaptive Programming patterns like Class Graph require separation of concerns which is the core idea of AOP. The Adaptive Programming has been established as a special case of AOP.
There are lot of Adaptive Programming and Aspect Oriented Programming resources available for programming languages like Java, C++, C#. We will look at some frameworks and some concrete examples in future posts.
Copyright Abhijit Nadgouda.