"Convention over Configuration is a software design paradigm which seeks to decrease the number of decisions that developers need to make, gaining simplicity, but not necessarily losing flexibility." -Convention over Configuration, Wikipedia
A very promising tool in an application designer's toolbox is a concept known as Convention over Configuration (CoC). It is related to the concept of Design by Convention (D by C) in that the "people" involved in D by C are end-users where CoC concerns developers. Addressing the conventions used by developers is generally what is involved in the creation of modern Software Frameworks. Probably the framework that most openly embraces CoC, and is my favorite technical movement born this century, is Ruby on Rails (RoR). RoR is a web-application development framework based on the Ruby programming language.
By decreasing the scope of change through the application of reasonable defaults, we define a box within which a designer/developer can truly thrive. They thrive because we reduce the cognitive load imposed by the approach allowing more crucial mental space for the complexities of the problem/solution. Cognitive load theory, in simple terms, says that people have a finite amount of mental space available for processing of tasks. To make people more effective, we must help them optimize their mental space (ie. reduce the cognitive load).
What does it mean to us? Convention over Configuration means that we follow a small set of well defined 'rules' or conventions that allow us to make simplifying assumptions about a solution space.
Putting CoC into Practice
Making your Conventions clear and malleable using the 5.3 feature called Declare Pages and the concept of DRY (Don't Repeat Yourself).
Rule-Declare-Page sets up a rule that will create a special sort of clipboard page that all requestors on a node will share.
Create a class to hold properties relating to the Conventions that your application requires.
An activity that simply uses a model to populate the page will be used to "load" the page to the clipboard when accessed the first time.
The model sets the values to match your defined constants to drive your Conventions.
To use the Convention constants, put a reference to Declare_Conventions - IQ-Convention into your Pages and Classes and then refer to its properties as usual.
.pyAssignedOperator = Declare_Conventions.WorkBasketPrefix + .ProductCode + Declare_Conventions.WorkBasketPostfix
On the clipboard, you can see the Declare_Conventions page contains the properties and values that you defined.
After the activities run, you can see that the values have been used in the concatenated Property-Set.
What Conventions are set in this example?
- All WorkBasket names will be the ProductCode with the value "@IBX" appended.
- All Skill names will be the HoldCode value with the value "ITS_MHSHC_" prepended.
Now that we can make the Convention and know how to utilize the conventions, what are the conventions that drive the design of your current system?
Labels: Public