Thursday, 10 May 2007

Knowledge gained in pattern course

As the saying goes “Knowledge is Power” the evidence of knowledge to man is beyond fathom. There is no end to whom who seeks it.

We are privilege to different knowledge which could be assessed through different means but the knowledge I have received through Pattern design is a mind opener. What I had know shed or reflection of lights on before.

The knowledge I received afterward has caused resurgence rather expose my being to a different level of perception and understanding the essence of Pattern design and solution to problem.

Pattern design is beyond the ready made I used to see or what most people see but it’s more of dedicated evaluation of what problem that occurs regular and what solution given to the problem so that it we not rehappen again.

I discover a lot of knowledge about pattern design it is beyond my thinking before. At first I taught pattern design is an easy course but not until when I read through so many patterns designer work like Gang of four pattern design and Alex i now discover that it is not easy to be a pattern designer.


During this course I lean to know about how a good pattern should look.
1. A good pattern must have a name
2. A good pattern must have a problem that you want to solve.
3. A good pattern must have a context.
4. A good pattern must have solution and also rational
5. It must be well explanative to new designer

Conclusion
I appreciate the Knowledge I’ve acquired in the process of the course (Pattern software design) and I also appreciate the privileged I have to attend this college under Portsmouth University. Lastly I thank God almighty for his grace he has given to me throughout this course also I thank God for my lecture Dr sri he has really help in the process of the course. I enjoy the course more than any other course because of the interaction with other student on the net.

Thursday, 3 May 2007

Anti pattern

Antipattern

In the post today am going to talk about Anti pattern. Anti pattern was the topic in class today of which i really enjoy. So what is Anti pattern according to W.H Brown he explain that anti patter is a literary from that describes a commonly occurring solution to a problem that generates decidedly negative consequences. [4]

In my own understanding antipattern is a solution that does not solved a reoccuring problem in its context. Antipatter appear when a solution is decided and deployed but the context and forces are not factored and consequences of the solution are not considered.

An antipattern is a pattern that tells how to go from a problem to a bad solution so therefore people try avoiding the solution give.

Reference

[1]. http://www.cmcrossroads.com/index2.php?option=com_content&do_pdf=1&id=6663



[2].
http://whatis.techtarget.com/definition/0,,sid9_gci863345,00.html


[3]. http://www.google.co.uk/search?hl=en&defl=en&q=define:Antipattern&sa=X&oi
=glossary_definition&ct=title

[4]. Antipatterns, W.H Brown et al, Wiley, 1998

Strategy Pattern

[3] In the lesson today we talk about strategy pattern of which the lecture explain to us on how we can make use of strategy pattern . Furthermore he explain that strategy pattern reduce so many object into one class . I also read something about strategy pattern on the internet this give me more understand of what the lecture is expalining to us about strategy pattern. The below is my own understanding about strategy pattern and i also get some inforation on the internet which i make reference on.

Strategy pattern

The strategy pattern consists of decoupling an algorithm from its host and let the algorithm vary independently from client that use it. It also encapsulated the algorithm into a separate class. And it often ends up bring a code in a table that specifics which algorithm to use. When you are using strategy pattern to design it help in reducing these several object to one class and provides a nice alternative to sub-classing an object to achieve different behaviors. [2]


Strategy pattern of benefits and where to use it

  • Encapsulate various algorithms to do more or less the same thing.

  • Need one of several algorithms dynamically.

  • The algorithms are exchangeable and vary independently

  • Configure a class with one of many related classes (behaviors).

  • Avoid exposing complex and algorithm-specific structures.

  • Data is transparent to the clients.

  • Reduce multiple conditional statements.

  • Provide an alternative to sub classing.

  • Related patterns include [1]


Reference


[1] http://www.javacamp.org/designPattern/strategy.html

[2] http://www.exciton.cs.rice.edu/JavaResources/DesignPatterns/StrategyPattern.htm

[3] http://en.wikipedia.org/wiki/Strategy_pattern


Decorator patter week 6


http://www.exciton.cs.rice.edu/JavaResources/DesignPatterns/DecoratorPattern.htm

The diagram is an example of decorator paining.

In the lesson today we were taught how to make use of decorator pattern and also the decorator pattern works. The following is my own explanation about decorator pattern

Decorator Pattern

A decorator pattern is used for adding additional functionality to a particular object as opposed to a class of object. It also work by wrapping the new decorator object around the original object which is typically achieved by passing the original object as a parameter to the constructor of the decorator. An example of decorator is paining a picture you can pain a picture without using a frame for it but if you want to beatify the paining you can add a frame to the picture painting. The frame added to the picture paining is an additional functionality and that is the work of decorator because it brings the best out of the picture paining out.

.