Tuesday, 20 March 2007

Critical Evaluation of PAFSD Coursework

Task One: Designing with pattern

In task we have been asked to design an application which stores customer records and enable users to view the customer records in variety of ways.

According to course work we have been agreed the option to use all of the following patterns

Strategy
Decorator
Adaptor

In first instance I see it as limiting the student to design the applications in such away that using the pattern mentioned above becomes mandatory. It seems like we are only focusing on the patterns mentioned above which narrows down the scope of learning.

In the mean time, it is not possible to cover all the patterns so it is viable to be selective and use the patterns has been suggested.

According to the industry and the software developer the three patterns mentioned above are very useful and handy.

Task 2: Coding with Patterns

It’s a good opportunity for a student to probe him/herself especially those with an interest in programming. I am interested in programming specially java. It is always been my dream to explore the beauty of programming language such as java. In this work I have the opportunity to learn about pattern and their implication in programming application. My initial understanding about pattern is it might help a programmer to beautify and structure their program.

Before learning about design pattern I used to jump on to the code before thinking or analyzing about the given scenario which is of course not a good programming practice but design pattern given me a new thought of thinking and adopting patterns for solving problems. I am looking forward to use my learning in this case when I will be writing the codes

Task 3: Patterns and software development

Out of all the tasks, I have liked this particular task as like most of the computing student I am interested in web and graphic designs. What more is interesting I am a freelance website designer (www.immysnet.co.uk) so I can definitely learn pattern in website from this task and apply in my practical life.
I had a look on the website pattern mentioned in course work and realized that it is really important to have a pattern for personal website as it helps all the designer / user to follow guidelines and keep their website up to date. I am sure it would be beneficial to have a adopt design patterns for website as the market demand for web based business are on high.

Task 4: Critiquing Patterns

To me this part of the course work is the trickiest one. I see “Anti pattern” as a controversial topic in design pattern but in the mean time I find beauty where there is controversy! Life is not all rosy so as the design pattern.

If I were to do this task I would definitely enjoy the challenge but at the I would like say what my friends says about anti-pattern

“If you are on target there are plenty of marks can be scored and on the other hand if you are off the track and get carried away it might proved to be a disaster.”

Task 5: Patterns Blog

Well, blogging is a new concept in learning now. To be honest I am enjoying blogging. It gives me the freedom of expressing myself and communicates; rationalize my opinions with rest of fellow mates via their blogs. New innovation of web 2.0 blog becoming popular and always been thinking of blogging but this course has given the option of doing so.

I think it’s a great inclusion and reflection of innovative idea to the course work.

Abstract Factory Design Pattern

Abstract!

“Abstract” sounds pretty technical but what exactly it means in English which might help to clarify the functions and meaning of abstract in design pattern. Well, I thought I might as well find out the synonyms of abstract and try to relate it to the design pattern. Below is the result, this is what I have found from answers.com

“Considered apart from concrete existence”

“Not applied or practical; theoretical”

These two lines of sentence did give me a bigger picture of abstract factory pattern. So let’s define it formally

Abstract Factory Design Pattern

I have been looking for some formal definition of abstract factory pattern and gather the following definition below
“An abstract factory class defines methods to create an instance of each abstract class that represents a user interface widget. Concrete factories are concrete subclasses of an abstract factory that implements its methods to create instances of concrete widget classes for the same platform.” [1]

The definition sounds a bit technical but what I think about this pattern is it lets you take concern of the bigger picture and worry about the facts later. The main intent of this pattern is to 'provide an interface for creating families of related or dependent objects without specifying their concrete classes' [2].
Analogy

A fine analogy for this is a pasta maker. A pasta maker will make different types of pasta, depending what kind of disk is loaded into the appliance. All disks should have definite properties in general, so that they will work with the pasta maker. This specification for the disks is the Abstract Factory, and each specific disk is a Factory. We will never see an Abstract Factory, because one can never exist, but all Factories (pasta maker disks) inherit their properties from the abstract Factory. In this way, all disks will work in the pasta maker, since they all conform to the same specifications. The pasta maker doesn't care what the disk is doing, nor should it. You turn the handle on the pasta maker, and the disk makes an exact outline of pasta come out. Each individual disk contains the information of how to create the pasta, and the pasta maker does not.

Structure

The Abstract Factory defines a Factory Method per product. Each Factory Method encapsulates the new operator and the concrete, platform-specific, product classes. Each "platform" is then modeled with a Factory derived class.

Finally we can say the intent of this pattern are

1. Provide an interface for creating families of related or dependent objects without specifying their concrete classes.

2. hierarchy that encapsulates: many possible "platforms", and the construction of a suite of "products".

3. The new operator considered harmful.


References:


2.Design Patterns: Elements of Reusable Object-Oriented Software By Erich Gamma, Richard Helm, Ralph Johnson, and John Vlissides [page: 87]