View this PageEdit this Page (locked)Attachments to this PageHistory of this PageHomeRecent ChangesSearch the SwikiHelp Guide
Hotspots: Admin Pages | Turn-in Site |
Current Links: Cases Final Project Summer 2007

Discussion 2 - Vinayak Kashyap

Vinayak Kashyap
09/16/2005
gtg217g


Part 1
How do design patterns and pattern languages differ? What is the use of each?

With regards to computer science and software engineering, a design pattern is a catalogued solution or template that has been applied in various situations to produce well-designed reusable software [1]. Since design patterns provide general solutions, they can help developers/designers avoid common pitfalls that may not have been conceived until the implementation phase [2]. The simplest way to think of a pattern language is as a mix of realted design patterns. In other words, a pattern language describes good design practices within a particular domain. Within a pattern langauge, the outcome/decisions made in one design pattern can influence other design patterns [3].

Part 2
Describe one design pattern or pattern language in your own words. Again, reference your sources. Explain what interests you about this pattern. Does it make sense to you? Can you see using it in your coding? If so, what for? If not, why not?

Proxy is an example of a structural design pattern available in Java. The Portland Pattern Repository defines a proxy object as "one through which we control access to the actual object on which the functionality lies [4]." In other words, it controls the access and creation of objects of another class. There are three types of proxies: virtual, remote, and protection. Virtual proxies are used for creating expensive objects on demand, protection proxy is used for controlling acess to objects and a local remote proxy object controls acess to a remote subject object [5]. It would be very difficult to develop safe and reliable client-sever applications without the use of a proxy. Wile designing a client-server application, I would consider using a protection proxy to check for a client's acess permission before allowing the client to execute methods on the actual object. It seems like the major demand for proxies occurs when designing OO client-server or networking apllications.

Sources:

[1] http://www.javaspecialists.co.za/designpatterns/brochure.html
[2] Wikipedia - Design Pattern. http://en.wikipedia.org/wiki/Design_pattern_(computer_science)
[3] Wikipedia - Pattern Language. http://en.wikipedia.org/wiki/Pattern_language
[4] Portland Pattern Repository. http://c2.com/cgi-bin/wiki?ProxyPattern
[5] JavaNotes. http://www.fluffycat.com/java/JavaNotes-GoFProxy.html

Link to this Page