what design pattern to use in this simple problem?
Hi there,
help is very needed here as I don't know what pattern to use? (newbie)
here's the deal: I have an empl that have the following information:
1. account (id, first, name,...)
2. projects (id, name of project, duration...)
3. account_info (login_name, lastloged...)
etc
when the empl logs in, I need to get all of those information, what design pattern should I use?
Facade, Command or Factory (there are diff empl)?
in the facade I can do this:
facadeEmpl()
{
//get account
//get projects
//get info
}
but isnt that like the command design pattern? Not sure.
can anyone help here.
thanks
> Hi there,
>
> help is very needed here as I don't know what pattern
> to use? (newbie)
>
> here's the deal: I have an empl that have the
> following information:
> 1. account (id, first, name,...)
> 2. projects (id, name of project, duration...)
> 3. account_info (login_name, lastloged...)
> etc
>
> when the empl logs in, I need to get all of those
> information, what design pattern should I use?
Who says you need a design pattern?
>
> Facade, Command or Factory (there are diff empl)?
None of the above. Sounds like you need an SQL or LDAP query.
The Data Access Object comes to mind.
You sound like you've got "small boy with a pattern" disease.
%
"small boy with a pattern" I like it :-)
SQL is mandatory, no question! there's a DAO for that BUT, and maybe i didn't state my question correctly, I need a BEAN! so all info will be transfered to the business layer. Now, since I need (1) account info (2) project info (3)...(4) doesn't that require me to have a facade? command?
> "small boy with a pattern" I like it :-)
>
> SQL is mandatory, no question! there's a DAO for that
> BUT, and maybe i didn't state my question correctly,
> I need a BEAN! so all info will be transfered to the
> business layer. Now, since I need (1) account info
> (2) project info (3)...(4) doesn't that require me to
> have a facade? command?
Maybe you can create one bean that has an account, project, and user reference all packed inside it. what would the abstraction be? Credentials, perhaps?
Don't care what pattern you call it. I'd say it's just designing with objects. Everything need not be a GoF pattern.
%
> "small boy with a pattern" I like it :-)heh heh good to see you didn't take it as the insult it isn't! somebody actually wrote to Erich Gamma - one of the GoF - and asked for advice as he was unable to incorporate all 23 patterns into his project! talk about missing the
> > "small boy with a pattern" I like it :-)
>
> heh heh good to see you didn't take it as the insult
> it isn't! somebody actually wrote to Erich Gamma -
> one of the GoF - and asked for advice as he was
> unable to incorporate all 23 patterns into his
> project! talk about missing the point!
Indeed. I've had a bout or two of the disease myself. I'm better now. 8)
%
> Everything need not be a GoF pattern.Heresy! ;o)yawmark (<-- Observer)
> heh heh good to see you didn't take it as the insult
> it isn't! somebody actually wrote to Erich Gamma -
> one of the GoF - and asked for advice as he was
> unable to incorporate all 23 patterns into his
> project! talk about missing the point!
This is pretty funny, because some people treat the GoF book as such canon that they think there ARE only 23 patterns.
Lots of other great stuff out there, including:
http://www.amazon.com/gp/product/0471958697/ref=wl_it_dp/102-0577819-2536135?ie=UTF8&coliid=IQR2KUSL6MO38&colid=D2F70PJMWJYC
http://www.amazon.com/Patterns-Enterprise-Application-Architecture-Martin/dp/0321127420/sr=1-1/qid=1164213061/ref=pd_bbs_sr_1/102-0577819-2536135?ie=UTF8&s=books
http://www.amazon.com/Enterprise-Integration-Patterns-Designing-Addison-Wesley/dp/0321200683/sr=1-2/qid=1164213061/ref=pd_bbs_2/102-0577819-2536135?ie=UTF8&s=books
%
> > Everything need not be a GoF pattern.> > Heresy! ;o)> > > yawmark (<-- Observer)That's a Flyweight argument.%
> > Everything need not be a GoF pattern.
>
> Heresy! ;o)
>
>
> yawmark (<-- Observer)
I'm an atheist, so heresy means little to me. I'd prefer to say it goes against all reason
george (<-- Adapter)
any other Visitors ( a two-fer :-)) want to add anything?
> I'd prefer to say it goes against all reasonIf you're not writing HelloWorld with GoF patterns, you're wrong. ;o)Can somebody call a Moderator?~
> That's a Flyweight argument.Indeed. Right up there with "Java is slow", and "Java is pass-by-reference for objects". :o)~
> > I'd prefer to say it goes against all
> reason
>
> If you're not writing HelloWorld with GoF patterns,
> you're wrong.
>
> ;o)
>
> Can somebody call a Moderator?
>
> ~
alright, alright, compose yourself! don't get in such a state, you're misinterpreting me
> alright, alright, compose yourself! Is that a request, or a Command?> don't get in such a state, you're misinterpreting meBut my Strategy is paying off already...~
> > alright, alright, compose yourself!
>
> Is that a request, or a Command?
>
> > don't get in such a state, you're
> misinterpreting me
>
> But my Strategy is paying off already...
>
> ~
10 duke dollars to the most creative pun on "singleton" or "proxy". I'll mediate
> 10 duke dollars to the most creative pun on> "singleton" or "proxy". I'll mediateI'm sorry, George, I don't recall your being added to the Chain of Responsibility here.%
> > 10 duke dollars to the most creative pun on
> > "singleton" or "proxy". I'll mediate
>
> I'm sorry, George, I don't recall your being added to
> the Chain of Responsibility here.
>
> %
I was. definately. I left you a memento, didn't you get it?
> I was. definately. I left you a memento, didn't you get it?Obviously my Proxy failed to forward it. I'll be speaking to her...%
I'll have to ask her about a new Decorator, too. I need to add something new to this place.%
> > I was. definately. I left you a memento, didn't you> get it?> > Obviously my Proxy failed to forward it. I'll be> speaking to her...> > %her? is she pretty? is she a singleton? what's her number?
> > > I was. definately. I left you a memento, didn't
> you
> > get it?
> >
> > Obviously my Proxy failed to forward it. I'll be
> > speaking to her...
> >
> > %
>
> her? is she pretty?
She's got quite a Wrapper, indeed.
%
> > > > I was. definately. I left you a memento,
> didn't
> > you
> > > get it?
> > >
> > > Obviously my Proxy failed to forward it. I'll
> be
> > > speaking to her...
> > >
> > > %
> >
> > her? is she pretty?
>
> She's got quite a Wrapper, indeed.
>
> %
that's cheating. I thought we were punning on GoF
well, as long as she's not married to some burly builder, I'd love to iterate 'er (sorry)
> that's cheating. I thought we were punning on GoF
Isn't Wrapper a synonym for Adapter? More evocative, especially when speaking about my lovely Proxy.
> well, as long as she's not married to some burly
> builder, I'd love to iterate 'er (sorry)
Is your Iterator bidirectional?
%
> > that's cheating. I thought we were punning on GoF
>
> Isn't Wrapper a synonym for Adapter? More evocative,
> especially when speaking about my lovely Proxy.
is it? I'm not so sure. an adapter may be a wrapper, but then, don't decorators, and proxies also wrap objects?
> > well, as long as she's not married to some burly
> > builder, I'd love to iterate 'er (sorry)
>
> Is your Iterator bidirectional?
>
> %
insofar as it goes in and out. it doesn't go both ways, if that's what you mean.....
LOL! Thanks for the clarification.Have a great holiday, George. It's been a pleasure to see you here.Sincerely, %
GuysIt has been a pleasure reading your posts!enjoy your holiday
> LOL! Thanks for the clarification.
>
> Have a great holiday, George. It's been a pleasure
> to see you here.
>
> Sincerely, %
holiday? of course, it's Thanksgiving, isn't it! I'm in ye olde UK, so that didn't click at first
thanks, both of you. enjoy your holidays!
> holiday? of course, it's Thanksgiving, isn't it! I'm> in ye olde UK, so that didn't click at first> > thanks, both of you. enjoy your holidays!What George says ...kind regards,Jos (< delegator, a bit slow but still ;-)
JosAHa at 2007-7-21 13:17:18 >
