Tuesday, June 07, 2005

Re: Are Design Patterns How Languages Evolve?


Are Design Patterns How Languages Evolve? Any thoughts?

.NET introduced the concept of "Attributes". Java 1.5 came out with a similar concept called "Annotations".

It's interesting to see the evolution of languages and how newer features are just formalized notions of what you could do before that feature came to be. More often than not, it was just "hacking" a feature for something it was'nt really meant for.


The links provided by Mohn did confuse me in a way. We could probably have a bit to discuss on this topic.

Design patterns and what Mohn mentioned are different concepts IMHO.

Mohn made a very interesting point about how newer features are added to langs, which were not initially thought of. And sometimes the 'hack' is not so clean as in Generics in Java. I think this is just happening to make the langs more developer-friendly, which is good in a way.

Design patterns are generic solutions to a particular set of problems. Take for example the Singleton pattern. This pattern helps in creating a class of which only a single instance will exist to the most throughout the lifetime of the application. Design Patterns are solutions built over OOP's concepts.

Design Patterns are now being built into languages. Iterators we use within Java Collections can be mapped to the Iterator Design Pattern. Similarly the Java Swing API heavily uses the Observer pattern and others too. The Observer pattern can be used easily in Java by using java.util.Observer and java.util.Observable. The Proxy pattern is also implemented in a way in Java. Mohn had an example ages back(.. which I still haven't read completely!!). The MVC pattern was initially thought of in SmallTalk. But nowadays many languages(or should i say libraries) provide MVC out-of-the-box. Like Mohn mentioned about ASP.NET v2. We now use many Design Patterns without even realising they exist. Many patterns are adapted to better fit the framework so look totally different.

So is this the author is talking about?? But again what I am talking about are not language extensions .. rather just API additions. Mohn mentioned language extensions but somehow I could not relate those to Design Patterns... Any ideas??

No comments: