Tuesday, 27 February 2007

Patterns and other reusable solutions: the differences

In pattern discussions, we have been talking about “reusable solutions” quite a lot. I was wondering what are other reusable solutions and how similar or how different is patterns from them? After doing some research, I found out the answer. Here is the summary of my findings:

Other reusable solutions: Framework, Architecture, Methodology, OOP and so on.

Let’s see how different they are from patterns:

Design Pattern: Design pattern is more like a concept. It provides a proven solution to a specific problem with a very well specified context. A particular pattern can not be applied outside its defined context because different problems have different specific contexts and one pattern can no way be applied to another problem. If the context changes, so does the solution. A pattern is completely independent of any programming language or API.

Framework: A Framework is a general specification which is a collection of classes and interface APIs working together to solve a particular type of problem. In other words, Framework is a skeleton of code used for developing an application. And a Framework can consist of one or more design patterns but the opposite is not possible.

Architecture: Architecture is contextual. It defines how or which component is placed where. For example, a system architecture will specify which application components are placed how and where.

Methodology: Methodology is the way or style of doing a particular task. There are various methodologies that are normally followed. For example, Waterfall model is a methodology of System Development Lifecycle (SDLC), PRINCE2 is a project management methodology and there are specific methodologies for testing as well.

OOP: Object Oriented Programming is a concept for more efficient application development. It is not a solution to a particular problem rather it sets out rules of writing program codes more efficiently. OOP uses reusable components for future use. OOP concepts are used in Design Patterns but the opposite never happens.

Tuesday, 20 February 2007

Patterns – How I see it

Pattern as a whole is about defining a solution of a particular problem (Under specific context) that occurs over and over again. The main idea or purpose is to create reusable solution to a recurring problem.

Even though the idea of pattern was first adopted by the Civil Engineer Christopher Alexander, patterns have roots in many disciplines, including literate programming, and most notably in Alexander's work on urban planning and building architecture. (Alexander, 1977) [1]. The goal of the pattern community is to build a body of literature to support design and development in general. There is less focus on technology than on a culture to document and support sound design. Using pattern in project can speed up the project process by providing tested and proven development paradigms.

Patterns are…
ü Solutions to recurring problems of design
ü Practical/Abstract solutions to real world problems
ü Context specific
ü "Best-fits" for the given set of concerns/trade-offs
ü "Old hat" to seasoned professionals and domain experts
ü A literary form for documenting best practices
ü A shared vocabulary for problem-solving discussions
ü An effective means of (re)using and building upon existing wisdom/experience/expertise
ü Massively hyped!

Patterns help us because they…
ü Solve recurring problems
ü Capture knowledge/expertise from certain domain
ü Document design decisions and rationale
ü Reuse wisdom and experience of master practitioners
ü Convey expert insight to novices
ü Form a shared vocabulary for problem-solving discussion
ü Show more than just the solution:
-context (when and where)
-forces (trade-off alternatives, misfits, goals + constraints)
-resolution (how and why the solution balances the forces)

A Pattern in everyday life
Name: Turning off Windows Automatic Update.

Problem: The Automatic Update icon of Windows Security Centre is constantly on the system tray and keeps popping up security and automatic update messages every few minutes. How to get rid of the annoying Security Centre messages and update Windows when you are free rather than letting it keep bothering you?

Context: The Windows Security Centre keeps checking for the updates available if the computer is online and notifies the user. Even if the computer is not connected to the internet, it keeps telling the user about updating the computer. This process loads along with Windows and it keeps an icon in the system tray which keeps popping up a message every few minutes. Sometimes it is very disturbing when you are doing something important and in no mood of losing concentration. It can be scheduled but it still is annoying. Moreover, as it loads every time when windows boots up, it uses a share of the RAM which might make other programs and the computer work slow.

Forces: Windows is designed in a way that it will keep checking for the updates as Microsoft knows about the loopholes or bugs in their Operating system. Besides, hundreds of new virus threats are coming up every day. To protect the PC against all the threats, updates need to be installed. Even Antivirus Software is installed in the computer, Automatic Update is still necessary as it not only updates for security threats but also updates for smoothly running Windows Operating System.

Solution**: Windows Security Centre can be disabled following the steps below-
Ø Go to Start > Control Panel.
Ø Double click on Administrative Tools.
Ø Double click on Services.
Ø When the Services Window comes up, scroll down to find Security Center.
Ø Double click on Security Center.
Ø The Security Center Properties window pops up. On the window you will find four buttons in a row… Start, Stop, Pause and Resume. Click on Stop. That will stop the programme.
Ø Go to the Startup type combo box field and select Disable.
Ø Click Apply and then click OK.
Ø Restart the computer.

Caution: As this solution permanently stops Security Centre and automatic update, don’t forget to check for updates manually and update your computer occasionally to keep Mr Windows up to date so that it can not let you down one more time.

** This solution is completely free of any risk and it is totally up to you whether you want to apply the solution or not. I hold no responsibility for any kind of Security issues or problems that might occur because of permanently disabling Security Center and Automatic Update on your Computer.


Reference:
[1] A Pattern Definition
URL: http://hillside.net/patterns/definition.html
Viewed On: 8 February 2007

Thursday, 15 February 2007

Hello World...

Hi all,

It's a bit unusual to to choose a title like- Hello World, you might think. But as we all start our programming with the hello world program, i thought it's not a bad idea to start my blogging with that title.

Well... here I am, new to the world of blogging. The purpose of my blog is to post my thoughts about Software Patterns and share ideas with a world full of people. I'm doing my final year in Software Engineering and in this semester i will be doing the Patterns for Software Development module. We have had few lectures already and in the following weeks i will be posting my thoughts about software patterns. I'm hoping to get feedbacks on my posts and blend your ideas with mine.

Hope to hear from you soon...

Zaman