Thursday, September 9, 2010

MVVM architecural pattern and TRINITY!

This would be my first post on this blog-been putting off starting this blog for a long while now! Oh how the mighty have fallen, slain by the thief called PROCRASTINATION. Well I finally did, thank God I recovered.
Let me introduce myself and then the blog. I am a technology specialist - a software developer - quite IT geeky :-). Now I found that I have musings and thoughts about things in my field - IT which is overwhelmingly digital and find them beig linked intrinsically or essentially to things in life that ain't so digital (analogue). Hence the name digitalanalogies!
Ok...I know this is not a detailed introduction but this is essentially what I do in this blog. Now to business.

MVVM an acronym that stands for Model View ViewModel. It's actually three things involved here even though it looks like four. The Model stands for the data access layer, a tier that controls access to-Creating Retrieving Updating and Deleting(CRUD)- records in a Database- a storehouse for our information. It could do this through Web service calls or even data context in a RIA scenario - ok enough of acronyms(smile) i promise to resist the urge to use them.
Yes, on to the next...View is simply as the name suggests, VIEW- what you see on your computer screen, the buttons you click, the textboxes you enter data into etc. In short, its the part you and I (as users Oh!) really see. It has minimal or ZERO code at all.
Finally, the Mayonnaise or butter that sandwiches the two i mentioned above...the POWERFUL ViewModel! This guy contains the main code that first of all receives data from the Model and formats it in a way that the View can appreciate it then connects and throws it out to the View which we can see. Now it also takes care of monitoring the view for changes to the data that were put out and responds to commands triggered on the view by the user.

Now, this TRIAD reminds me of TRINITY...yes I know what you are thinking-Father, Son and Holy Ghost. But I got something else in mind. The body, soul and spirit of man.

Your body is the only thing people see about you right? So that would be your view. That's the part that qualifies you to be in this world. Its the ultimate User Interface (UI) created by GOD. The part everyone can see and interact with. The one they call you. Its your house really.
Your spirit is the part God sees and deals with. In fact that IS the REAL DEAL. Its the part God can get to and talk to and receive from...God's USER INTERFACE! God is Spirit and is supposed to be our Source. He is the ultimate Database of TRUTH and GRACE-everything Good and Perfect.Our spirit was designed to seek Him and carry Him hence give to and receive DATA from Him. So in our case our spirit is the Model.
The meat of the M-V-VM Sandwich(the meat comes in between, I wonder why this one comes last!), the Soul! It links the Model (spirit) and View (body) together. In fact the link is so VITAL that if the soul prospers the body would reflect it.(1 Jn 3:2) Stress, negative emotions-murmuring, complaining, slandering, bitterness etc. will work against it. IT enables the body to receive and enjoy the data that the spirit has to offer in abundance.
Now let's see where we err and take measures to put things right especially where our souls are concerned. It is a very vital trinity that MUST work if we MUST succeed! Think about it!