Before I understood what design patterns were, I had a hard time trying to understand the difference between Design Patterns and Frameworks.
Design Patterns :
When you encounter a specific kind of problem during design, you group similar problems and apply a common solution to them and that solution is a design pattern. For eg, in an Email application, my email view (Inbox) has to be updated everytime I receive a mail. In a Stock Trading application, share prices of my portfolio has to be updated (I might view my portfolio as a chart / graph / etc) everytime the share price in the market changes. A common solution to this pattern of problem is called Observer pattern (you could use Model-View-Controller) as well where you have a Subject (email application / stock trading application) updating an observer(Inbox / Chart/ Graph of the trading appln) of any changes. It definitely takes experience to apply the right design pattern to the right problem.
Framework :
A framework is a set of classes and interfaces that make up a reusable design. It is built on top of one or more design patterns and have supporting class libraries to help design reuse. For eg, Struts framework provides a bunch of supporting libraries for a Model-View-Controller design pattern.
Some of the differences specified in the GOF book are
1. Design patterns are more abstract than frameworks.
2. Design patterns are smaller architectural elements that frameworks.
3. Design patterns are less specialized than frameworks.
"For God so loved the world, that he gave his only begotten Son, that whosoever believeth in him should not perish, but have everlasting life." - John 3:16
Thoughts and musings on Technology, Security and me.
Showing posts with label oops. Show all posts
Showing posts with label oops. Show all posts
Friday, July 20, 2007
Sunday, July 01, 2007
Learning Smalltalk
I am doing my Object Oriented Programming and Design course this summer and our prof Ralph Johnson is teaching us OOPD using Smalltalk. I am thrilled to learn smalltalk. I was and am shocked to see so many Java concepts being derived out of smalltalk. I always admired the concept of VM and thought that Java was the first Language to have a VM but squeak (the flavor of smalltalk we use) uses VM and it is more than 30 years old. List of functionalities that seems (for me) to have been ported into Java from Smalltalk
1. VM
2. Collection utils and Collection hierarchy
3. Concept of "Object" class. In smalltalk, Object is the top level class out of which every class originates.
4. Equals and Hash functionality
5. The concept of workspace which is being used in famous IDE's like Eclipse.
I'll probably add to this list if I recollect.
1. VM
2. Collection utils and Collection hierarchy
3. Concept of "Object" class. In smalltalk, Object is the top level class out of which every class originates.
4. Equals and Hash functionality
5. The concept of workspace which is being used in famous IDE's like Eclipse.
I'll probably add to this list if I recollect.
Subscribe to:
Posts (Atom)