Architectural pattern - Naked object.
Background –
This model is very close to MVC (model-view-controller)
architectural pattern. I would recommend you to read MVC first if you have no
idea about it. MVC is very nice for any complex application, but when you are
dealing with a real time system where user is interested to monitor some specific
objects, then implementing it through necked object will be easy. Please look at
below mentioned diagram.
(This diagram of MVC is taken from free internet sources) |
(This diagram of naked object is taken from free internet source) |
I am sure that above mentioned diagrams would have given you
a good insight of what naked object is and how it is different from MVC, but
let us talk some example so that it gets clear.
Example 1, think about an ATC (air traffic controller) who
manage air traffic of airport, through switching on and off the lights on runway, so that
flight shall land and reach to its destination safely. Without giving proper
light indications to pilot, it will be nearly impossible to control air
traffic, and how pilot will know in which runway he supposed to land and other
important information to have a safe landing? Now what controller sees in his
screen is status of lights (On, Off, faulty) and take actions according to
situation. So no need to apply any complex architectures or MVC model to build
such application, as the very bottom layer is physical entity which is an
object itself, one light is nothing but one object and user (controller) is
interested to look the status of that object and want to change the status of
that object directly, there should not be any extra cross component is required
to execute any business logic.
Example 2, When you ride your car or bike, you will see many
indications at your front panel, they shows warnings and notifications about
your vehicle’s current condition, status about fuel, battery, seat belt, oil
etc..
Most of the controlling systems are like that, their
business logic is straight forward, each small entity is one object and we are
monitoring the status of those objects. So it is single-entity-direct-user-interaction
case and this kind of situation is best for naked object implementation or in other words this will implement object oriented user interface (OOUI). It is like you are
seeing fish in aquarium, crystal clear and direct, no extra layer, just
transparent glass and clean water, just like naked object.
About naked design pattern –
In this architecture, UI is directly representing underlying objects.
All business logic has to be encapsulated within your object. As name suggest
user sees each single object direct or naked, it should have all necessary login
in it, as that object itself is responsible to processing its own data.
Thanks for reading it. To read more on design patterns and basic design principles please see my web page. You can also join me on FB or on G++. Please drop comments for any question related to this blog.
Comments
Post a Comment