logo       

Re: Design with Visitor: msg#00271

lang.smalltalk.squeak.beginners

Subject: Re: Design with Visitor

Pay attention mathieu.
Design patterns can be evil too.
You do not really need a Visitor for your application.
Your performance classes are your domain and your seaside components your UI pointing to
the domain objects.

Why do you need a PerfomanceCollection class?

Why do you want to keep in your dictionary the class of its objects?

See you monday :)

Stef
On 25 mai 06, at 16:22, math wrote:


Subject: Design with Visitor
From: "Mathieu SUEN" <mathk.sue@xxxxxxxxx>
Date: Wed, 24 May 2006 23:14:58 +0200
To: beginners-bounces@xxxxxxxxxxxxxxxxxxxxxxxxxx

Hi squeakers,

I have to build a lite code for home work.
The objective is to gave to user a possibility to store his sport
performance.

So I have design a Class Performance(with PerformanceCollection) and I
wanted to let things like TimeLaps, Date, Distance, and so on.
for a later implementation (if we wanted to add others).

So I provide a Measure abstract class.

Hence I add a dictionary in my Performance with the class for key and
the instance for value:

for example:

Performance>>addMeasure: aMeasure
dictionaryOfMesure at: aMeasure class put: aMeasure

Now I have to bring them in a Seaside UI so I guess that Visitor Pattern
( ;-) ) can help me but my complex structure mess my brain.
So I ask you if you think that can be possible(and how) or other pattern
can be more suitable for this problem.

Thank you for your attention (:
_______________________________________________
Beginners mailing list
Beginners@xxxxxxxxxxxxxxxxxxxxxxxxxx
http://lists.squeakfoundation.org/mailman/listinfo/beginners


Thinking forward I see that 2 Performance instance couldn't be compare
so befor asking how to print them I will think about a other structure.
I think I will use Builder or Factory Method pattern.

Thanks
_______________________________________________
Beginners mailing list
Beginners@xxxxxxxxxxxxxxxxxxxxxxxxxx
http://lists.squeakfoundation.org/mailman/listinfo/beginners


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise