Showing posts with label design patters. Show all posts
Showing posts with label design patters. Show all posts

Sunday, June 09, 2013

Framework vs. Utilities (Level 100)

 

Where: Somewhere in earth.

When: More than a decade ago.

Me: Sir, what is a framework?

Architect/Team Lead: Oh, it is a set of utilities.

Years after, when I stumbled upon IoC (Inversion of Control)  and Dependency Injection, and articles from Martin Fowler, it dawned on me that Framework IS NOT JUST set of utilities. When I got the hang of it, I tried explaining the concepts to my fellow developers.

IoC is the one implementation which distinguishes a set of utilities from a framework. With IoC implemented properly, the Application is just part of the framework. Without IoC, Application is in control. Lets delve further.

Set of Utilities

Well, there wouldn’t be any project on earth without any set of utilities. Functions which are common across the application, which we abstract into small utility classes or functions. In this case, the Application is in control. The application decides when and how to use the utilities. For example, we go to our nearby McDonalds (or a nearby favorite fast food place). We are in control. We decide where to park our car (in spaces available of course :)), when to order, what to order, where to sit, where to hang our jackets. Got it?

Framework

UpscaleRestaurant

When we have a Framework, the application is a part of the framework. We have to register the application (or parts of the application to be used), and the framework will decide when and how to invoke our application. This concept is called Inversion of Control. Let’s suppose we go to any up-scale restaurant in New York City. Typically we have to make reservations (analogous to registering the application). THEY (the restaurant) will let us know what time is available. Once we reach there, THEY valet part our car. We wouldn’t have any idea where the car is getting parked. THEY usher us into the dining area, and get our jackets and hang it in THEIR own locker rooms. (You are getting the hang of it, rt?). Once we are done with the food, our jackets are returned and our car comes when we step outside. THEY take care of us. THEY are in control.  WE become part of their SYSTEM (analogous to the FRAMEWORK).

To know more about IoC and Dependency Injection, read this article: http://www.martinfowler.com/articles/injection.html.

Happy Programming.

Saturday, March 03, 2007

An attempt to learn Design Patterns

Months ago I had picked up a Design Patterns book titled Head First Design Patterns. This book took me to ride with the very first chapter. But unfortunately, due to busy work load, I could not continue reading the rest. And every time I see that book in my shelf, I feel guilty.

And again, it would not be my reading habit. It is the subject in itself. Unless and until you get your hands dirty by implementing the concepts discussed in this books, nothing would "remain" in your head. May be its just me.

I have decided to take it slow and get this book chapter by chapter. Read one chapter. Then discuss and share the principles with my peers. There are dudes at work who have similar interests in learning the design principles.

Monday, November 13, 2006

Design Patterns - The Why!

They say the term "Design Pattern expert" is a wrong usage. This is because if your developers do not have expertise on Design Patterns, then they do not appreciate whatever patterns you pick to use as a guideline.

During my early years of .NET, I was told to follow certain Design Patterns. But no one attempted to make me understand the concept and philosopgy behind those patterns. I started reading the GoF patterns (the Bible of design patterns!), but I couldn't understand a bit! Take that as my confession, but hey, I was not alone at all! Then later one day, I took the courage to admit that myself and James Avery. James helped me reach the Head First book on the same subject. Let me say, I was hooked onto it!

This month's UG meeting discusses the same topic - Why, What and How of Design patterns. The "Why" part, that is where I am more interested in. "Why should a developer be concerned about a Design pattern?"

My colleague, Vijay Cheleenhalli, a design pattern expert (oops!) is going to present the topic.

For registering for the event, please visit http://www.central-penn.net

Cookies, anyone?

  Our application started having integration issues early March this year. Did I say that was intermittent? To add to our confusion, we coul...