Hi all,
I've a doubt on Prototype design pattern. What SHOULD I use
while creating the new object?I mean,shd I use clone of the object (can
be either Deep or Shallow) or directly creation of the object using
'new' operator?
I guess,we have to use clone of the objects bcoz GoF says "create new
objects by copying this prototype".
Thanks in advance,
Ram.
-----Original Message-----
From: An interest list for Sun Java Center J2EE Pattern Catalog
[mailto:J2EEPATTERNS-INTEREST@(protected)
Sent: Wednesday, April 28, 2004 2:26 PM
To: J2EEPATTERNS-INTEREST@(protected)
Subject: Re: Doubts on design patterns
> -----Original Message-----
> From: Ram Kishore [mailto:ramkishore.pasupunoori@(protected)]
> Sent: 28 April 2004 05:52
> To: J2EEPATTERNS-INTEREST@(protected)
> Subject: Doubts on design patterns
>
>
> Hi all,
> I know design patterns are grouped into three types : Creational,
Structural, and Behavioral.
> But my questions are,
> 1) Why State pattern is listed as behavioral, when it clearly defines
some
structure.
It's point is it's change in internal state - i.e. it's behaviour...
> 2) Why Proxy is listed as a Structural pattern when it clearly has
behavior.
A proxy pattern links two entities, therefore is structural.
> 3) what is criteria for determining if a new pattern should be
considered
Structural or Behavioral?
The criteria is if the pattern is structural or behavioural. i.e. it
becomes
part of a structure, or exhibits some behavioural attribute. The
criteria is
defined really only for the Gang of Four (GoF) patterns. There is no
reason
why each pattern catalogue can not have it's own categories. For example
the
J2EE patterns catalogue (of which this is a mailing list) has
"Presentation
Tier", "Business Tier", "Integration Tier" patterns. Similarly, there is
no
real reason why you should define a category, only one of organisation
for
humans.
> 4) what is main difference between Decorator and Chain Of
Responsibility?
They are not really comparable as they are completely different - think;
"the
difference between a banana and a melon". The Chain of Responsibility
allows
you to use a bunch of objects to deal with a request only if the object
is
responsible for the request. The Decorator allows you to add additional
functionality to an object dynamically.
You can always visit www.javacoder.net and see the GoF patterns
implementation there.
HTH
Ben
********************************************************************
This email may contain information which is privileged or confidential.
If you are not the intended recipient of this email, please notify the
sender immediately and delete it without reading, copying, storing,
forwarding or disclosing its contents to any other person
Thank you
Check us out at http://www.btsyntegra.com
********************************************************************
====================================================================
Companion Site: http://www.corej2eepatterns.com
J2EE BluePrints: http://java.sun.com/blueprints/corej2eepatterns
List Archive:
http://archives.java.sun.com/archives/j2eepatterns-interest.html
Unsubscribing: email "signoff J2EEPATTERNS-INTEREST" to
listserv@(protected)
====================================================================
Companion Site: http://www.corej2eepatterns.com
J2EE BluePrints: http://java.sun.com/blueprints/corej2eepatterns
List Archive: http://archives.java.sun.com/archives/j2eepatterns-interest.html
Unsubscribing: email "signoff J2EEPATTERNS-INTEREST" to listserv@(protected)