Exforsys

Online Training

Pattern Clarification

This is a discussion on Pattern Clarification within the Software Patterns forums, part of the Testing category; Hi, Hoping someone could provide some direction on how to approach this problem using any GOF patterns. e.g. A ...


Go Back   Exforsys > Testing > Software Patterns

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 06-24-2005, 12:21 AM
danths@gmail.com
Guest
 
Posts: n/a
Pattern Clarification

Hi,
Hoping someone could provide some direction on how to approach this
problem using any GOF patterns. e.g. A project contains a team and a
team contains zero or more members, each with a specific role(s) e.g.
architect, programmer, DBA etc. Again assuming that each member is
either an employee or a consultant. If there are two questions that
need to be answered
# Which employee(s)/consultant(s) are involved in a project?
# In which projects is an employee/consultant involved and in what
roles?

I have been beating my head over something similar for the past 2-3
days without much success. Any help is much appreciated.


Thx!
sd

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 06-27-2005, 03:31 PM
Ted Hill
Guest
 
Posts: n/a
Re: Pattern Clarification

I think you could use the Composite and the Iterator patterns here.

Use the composite to model the Project-Team-Members 'tree'

Then implement an Iterator that will iterate over the composite.

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 07-04-2005, 09:25 AM
Giovanni Azua
Guest
 
Posts: n/a
Re: Pattern Clarification

Hi,

I 100% agree with using the Composite pattern BUT why is it needed
the Iterator? with the composite you just apply X() to the root and
that's it, it gets applied to the tree entirely ... that is precisely what
is so beautiful about using Composite ...

I do not see application of Iterator but I do see it would be useful
using the Visitor pattern. Would allow any branch of the tree to be
visited. An "Iterator" then would be kind of visiting the root node.

Best Regards,
Giovanni

"Ted Hill" <thill_NO_SPAM@tomotherapy.com> wrote in message
news:42C0461D.4050507@tomotherapy.com...
>I think you could use the Composite and the Iterator patterns here.
>
> Use the composite to model the Project-Team-Members 'tree'
>
> Then implement an Iterator that will iterate over the composite.
>



Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 07-04-2005, 09:35 AM
Giovanni Azua
Guest
 
Posts: n/a
Re: Pattern Clarification

Hi Sd,

As pointed out before it fits that you use the Composite
Pattern to model the tree structure. Have you thought about complex
cases (or are there?) ... e.g. some Employee or Consultant that is
Architect and also do DBA? If this is the case then I would considering
using Decorator pattern ... e.g.

Component genius = new Architect(new DBA(new Programmer(new Employee())));
genius.showoff();

Regards,
Giovanni

<danths@gmail.com> wrote in message
news:1119583307.675282.317490@o13g2000cwo.googlegroups.com...
> Hi,
> Hoping someone could provide some direction on how to approach this
> problem using any GOF patterns. e.g. A project contains a team and a
> team contains zero or more members, each with a specific role(s) e.g.
> architect, programmer, DBA etc. Again assuming that each member is
> either an employee or a consultant. If there are two questions that
> need to be answered
> # Which employee(s)/consultant(s) are involved in a project?
> # In which projects is an employee/consultant involved and in what
> roles?
>
> I have been beating my head over something similar for the past 2-3
> days without much success. Any help is much appreciated.
>
>
> Thx!
> sd
>



Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -4. The time now is 11:04 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0
Copyright 2004 - 2007 Exforsys Inc. All rights reserved.