Skip to Content.
Sympa Menu

gang-of-4-patterns - Re: [gang-of-4-patterns] new to design patterns

gang-of-4-patterns AT lists.cs.illinois.edu

Subject: Design Patterns discussion

List archive

Re: [gang-of-4-patterns] new to design patterns


Chronological Thread 
  • From: "Justin Daubenmire" <jdaubenm AT yahoo.com>
  • To: "Emilio Costa Giomi" <ecostagiomi AT hotmail.com>
  • Cc: gang-of-4-patterns AT cs.uiuc.edu
  • Subject: Re: [gang-of-4-patterns] new to design patterns
  • Date: Thu, 15 May 2008 11:07:44 -0400
  • List-archive: <http://lists.cs.uiuc.edu/pipermail/gang-of-4-patterns>
  • List-id: Design Patterns discussion <gang-of-4-patterns.cs.uiuc.edu>

Thanks Emilio for the advice.
 
Yeah, I can see your and Ray's point of patterns not being needed but only when a problem surfaces that merits it.
 
I'll need to keep this in mind as I try to learn/apply them.
 
Also, thanks for the book suggestion - I will have to read that book.
 
Does anyone have any other book suggestions?
 
Regards,
Justin
----- Original Message -----
From: Emilio Costa Giomi
To: Justin Daubenmire
Sent: Thursday, May 15, 2008 9:00 AM
Subject: RE: [gang-of-4-patterns] new to design patterns

> Could the user object be a subject and the calendar be an observer that
> could subscribe to the user object?
>
> Are there any patterns common to a one to one relationship between objects?

Justin, I think Ray Tayek gave you a  VERY good advice. Patterns, are mean to balance forces. So if you still don't have a forces fighting scenario you don't need a pattern. Patterns are one tool in our tool box, but there are many other things to think about. I know that you want to apply them... but if your context doesn't need them it's ok, it doesn't mean that your design is bad. In fact at this very moment we are working with a piece of software that it's completely over designed, full of visitors-singletons-strategies and it's a overcomplicated mess because the context doesn't deserver all this patterns. Take a look at Joshua Kerievsky "Refactoring to Patterns".

Anyway, as the calendar example seems to be kind of pattern laboratory, think about how are you going to create the calendar and what this object needs to work. You will probably need a factory.

Regards.



Emilio Costa Giomi

People has been robbed of their intuitions by specialists (C. Alexander)


> From: jdaubenm AT yahoo.com
> To: gang-of-4-patterns AT cs.uiuc.edu; rtayek AT ca.rr.com
> Date: Wed, 14 May 2008 19:31:45 -0400
> Subject: Re: [gang-of-4-patterns] new to design patterns
>
> Thanks Ray for the input and thoughts.
>
> I think the calendar and notes/reminders fall under the observer pattern.
>
> To all: my other question is the user object. The user object will have a
> one to one relationship with the calendar object. I am wondering if simply
> making the user object a singleton would be a good fit for this practise
> application?
>
> Is there another pattern that we could use to fit the user object into the
> observer pattern for the calendar/notes/reminders?
>
> Could the user object be a subject and the calendar be an observer that
> could subscribe to the user object?
>
> Are there any patterns common to a one to one relationship between objects?
>
> Any advice/feedback welcomed!
>
> Regards,
> Justin
> ----- Original Message -----
> From: "Ray Tayek" <rtayek AT ca.rr.com>
> To: <gang-of-4-patterns AT cs.uiuc.edu>
> Sent: Wednesday, May 14, 2008 5:22 PM
> Subject: Re: [gang-of-4-patterns] new to design patterns
>
>
> > At 10:57 AM 5/14/2008, you wrote:
> >>... multiple users so each user can have his/her own calendar,
> >>reminders, and notes. Users can attach multiple notes to a single
> >>date. Users can attach multiple reminders to a single date.
> >>
> >>So the main objects are: calendar, user, notes, reminders and they
> >>are classes, not even any GUI objects yet.
> >>
> >>As I sat down to program the application and select design patterns,
> >>I drew a blank!
> >
> > don't worry, you may not need any design patterns. wait for a design
> > problem to show up.
> >
> >>...programming, but design patterns are new to me so ..., can some
> >>of you please steer me to what design patterns I should use for the
> >>application?
> >>
> >>What design pattern would be good to use for reminders/notes? The
> >>calendar? users?
> >
> > none come to mind immediately. do some class design for a while.
> > write some code. wait until you have some design problem to solve.
> >
> > thanks
> >
> >
> > ---
> > vice-chair http://ocjug.org/
> >
> >
> > _______________________________________________
> > gang-of-4-patterns mailing list
> > gang-of-4-patterns AT cs.uiuc.edu
> > http://lists.cs.uiuc.edu/mailman/listinfo/gang-of-4-patterns
>
> _______________________________________________
> gang-of-4-patterns mailing list
> gang-of-4-patterns AT cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/gang-of-4-patterns


Get news, entertainment and everything you care about at Live.com. Check it out!



Archive powered by MHonArc 2.6.16.

Top of Page