Monday, September 19, 2011

MVC in a three-tier architecture

The increase of web and mobile software development can get one thinking about how to best design and architect an application for these platforms. The two proven approaches that find themselves into this discussion are the Model View Controller (MVC) pattern and the three-tier architecture. This post is meant to describe these two approaches and how I believe they should work together and why.

Model-View-Controller

The MVC Pattern
The MVC pattern provides very well when building applications that are to be consumed by many different platforms (it also provides well when you are building for a single platform). When targeting platforms that are mobile devices, tablets and different browsers on different operating systems the MVC pattern is a proven approach. The MVC pattern separates different parts of rendering the User Interface (UI) into modules, so the code for rendering the actual interface is separated from the code that manages the data which is also separated from the code that handles the user events.

Three-Tier Architecture
The 3-tier Architecture
The three-tier architecture separates the deployment of software components into three logical layers. These layers include;
  • Presentation Tier - responsible for rendering the User Interface
  • Business Tier (or Logic Tier) - responsible for processing the business rules or logic
  • Data Tier - responsible for interacting with the data storage system
This separation is for a number of reasons which include maintainability, reuse and deployment. When software is modularized and separated into these three-tiers, the modules can be deployed to different server infrastructures for security, scalability and performance. And the deployment approach can change as the need requires. The modules are also easier to maintain and reuse when they are each built for a discrete purpose.

The MVC implemented in a three-tier architecture
The MVC - Three Tier Hybrid
When the MVC and three-tier approaches are brought together the View and Controller are considered the presentation tier, the Model exists in the business tier (and has access to many business and data tier modules). To a certain extent the Model could span both the business and data tiers. It is this authors view that the Model would not exist in the layer of the data tier that is specifically Data Access Layer (DAL) code including SQL or code optimized for DAL within a cached environment.
Some important aspects of this diagram include is the separation of data reads from writes. Writes take considerably more data storage resources than do reads, so separating these into different physical data stores can have huge benefit. It should also identified that the modules for the business and data logic can be numerous. And these exist for maintainability and scalability purposes. It is also reasonable that the Model may access the Data Tier directly without going through a Business Tier module.

Why the hybrid?
The MVC pattern does not describe how to best design the data access and how to manage the complexity that can occur within the business and data tiers. As the internet has become more open and further entrenched in business processes, the demand to access the business tier without the presentation tier has increased. The creation of Business Tier modules allows for other approaches (such as REST) to access business logic from other sources, enabling business-to-business interactions and innovations.

Follow-up post
if you would like to read a non-technical post describing the MVC pattern within a three-tier architecture, follow this link; http://criticaltechnology.blogspot.ca/2011/10/mvc-in-three-tier-architecture.html 

Related reading

Monday, September 12, 2011

Realities of performance art

This spectacular photograph taken by Bill Pusztai captures so much of the time between dances, and from my perspective many aspects of Bowen Island Blacksheep Morris. I'll take you through the photo, left to right, and describe what I see from my perspective as a dancer, performer and friend to many in the picture. My thoughts may not be correct for others, but these are my perceptions.
  • Banjo Jim (far left, holding the banjo) - his smile comes from a deep satisfaction. Davie Days is becoming one of our favorite venues to perform, it is one of the places where the audience is as colorful as our dance kits. Jim loves to perform live and the positive energy from the audience is reflected in Jim's smile. This is one of the main reasons we perform, the joy of entertainment, the deep satisfaction which comes from performance art, sharing oneself with your smaller and larger community and the amazing friendships and camaraderie.
  • Gerald - I suspect Gerald is checking his hand for blisters. He always gives 200% during these performances and is most often to perform while injured. Which happens often when performing with sticks bashed by fellows at least 6 foot tall and over 200 lbs. Yes folks, Morris dancing takes some work. We practice (almost) weekly, we work on new dances most of the time and come up with (or learn) a new dance twice a year.
  • Squire Bob - Melodian player extraordinaire. Bob is always playing to the crowd, so no surprise his back is to the photographer as he is turned toward the audience. He provides the musical heart and fills the role of our Squire like no other. Without Bob there would be no Blacksheep Morris. Bob also incarnates the tradition of Morris... he has been performing Morris for more than 35 years and there is no corner of this tradition he is not familiar.
  • Peter - dancer, musician and fool... and master of none! (well, maybe the fool). Morris is as much about the music as it is the dance. And in either capacity I believe we all feel we could improve. The unique part of Morris dance is the relationship between the dance and the music and which takes the lead. For without one, you could not have the other... which one sets the tempo? which captures the most attention? From afar it is the music, it draws you in. Once engaged the visuals, and rhythm, of the dance take over. In the end, the music has to lead. This can be difficult when the dancers also use percussion instruments.
  • Graham - dancer, founder and drill sergeant. Without Graham we would likely have no discipline. The Blacksheep are about as disorganized as you can get when it comes to pulling off any kind of performance. Graham keeps us focused during our practices and works really hard at this in the hopes to bring some rigor to our performances... but, then of course it is very very hard to herd sheep. And Graham is no sheep dog.
  • Brian (far right, holding the drum)- mainland sheep, occasional sheep, wise sheep. I am always very excited when Brian joins us in either practice or performance. In fact, if any of the off island sheep show up I am excited. The sheep welcome all who choose to join and participate (regardless of gender, we are a mixed side). And many of those from off island bring a knowledge of music, morris and dance that makes us stronger.
  • All other sheep (not shown and too many to list here. You know who you are!) - if Squire Bob is the Heart of the Blacksheep then the whole herd is the Soul. It's amazingly eclectic mix of individuals, and those words were carefully chosen. We like that we have no theme within our outfits, many border morris sides have a chosen colour scheme, we have none. Individual freedom to create is desired. Eclectic mix, just get to know us. You may be surprised that such a diversity of backgrounds can so deeply enjoy each others company. 

So there you have it. What is it that happens between performances. Even though Morris dancing takes some work we do it for the deep satisfaction, camaraderie, love, friendship and connection to community. The music fills our hearts and grounds us into the tradition of Morris dancing. This perfomance art is as much about the music as it is the dance; amazingly, this eclectic mix of individuals finds the balance between discipline and disorganization to actually perform. We pride ourselves on being a mixed side where the Soul of our performances lies within every member of the side.


Thank-you Sheep... for the love and friendship, you all deepen and enrich my life!

Tuesday, September 06, 2011

Sharing the trial with mountain goats

Lisa, Lucas, Kai and Peter bag
Quiniscoe Mountain
My family and I spent the last week in Cathedral Lakes Provincial Park. What stood out for me the most is how our two young sons Lucas (6) and Kai (5) went on long hikes and bagged a few peaks each over 2500 m. They were pretty flipped-out in getting to the top of Quiniscoe Mountain (2551 metres). And to be honest, I am one proud father to think of the effort, endurance and goodwill they both showed in getting to the top of this mountain.

Quiniscoe Mountain seen
from Quiniscoe Lake
The Cathedral Lakes Provincial Park is an outstanding place to bring a family and both the Ranger (John Henry) and all the staff at the Cathedral Lakes Lodge were outstanding. During our stay in the park, we spent the first three nights camping and the last two nights in the lodge. During our last night of camping the temperature dropped to -2 degrees Celsius. All good as we had brought good sleeping bags and fleecy jammies... The food prepared in the lodge was outstanding and it was good to meet others who had spent their days hiking in the park and exploring its many lakes and mountain peaks. We even took the time to do some trout fishing, and Lucas caught his first lake trout. We cleaned it and cooked it on an open fire... yum. Unfortunately my presentation of the cooked trout wasn't the greatest and the boys refused to eat any. Note to self, when having the boys try a new food, presentation is important.

Another significant event was sharing the trail with two mountain goats. We were very fortunate to sit ourselves just off the trial and allowed these amazing creatures to pass.The fun part was having the goats peer back at us from over the small bluff after they had passed.


What were my big lessons while on this family trip?
  • Lucas and Kai love wildlife... they always want to see creatures, big and small, in their natural environment.
  • Sometimes, children need a firm reminder that they are capable and need to push though to achieve their goals (even if they have been set by their parents)
  • Durvla Murphy is correct in that we need to be reminded we are still animals and spending time in the solitude of the mountains is time well spent.
...To me that perfection of stillness is the grace of the mountains poured into one's soul.....I know and have always known that we 20th century humans need to escape at intervals from that alien world which has so abruptly replaced the environment that bred us. We need to be close to, and opposed to, and sometimes subservient to, and always respectful of the physical realities of the planet we live on. We need to receive its pure silences and attend to its winds, to wade thru its rivers and sweat under its sun, to plough thru its sands and sleep on its bumps. Not all the time but often enough for us to remember that we are animals. Clever animals yet ultimately dependent, like any other animals on the forces of Nature... - Dervla Murphy