Re: Patterns Question
- From: "Nick Malik [Microsoft]" <nickmalik@xxxxxxxxxxxxxxxxxx>
- Date: Wed, 29 Jun 2005 07:00:09 -0700
Hello Sameer,
I took a look at the pattern you referenced. If your requirements are as
you described in your initial post, then the referenced pattern is overkill.
The pattern you mention is not called the Role pattern. It is called the
Role Aspect Pattern, and is a proposal before a PLoP conference in Europe
(which means that the patterns community has not accepted it yet). If I
were at a PLoP conference and this paper were presented, I would challenge
it on the basis that it rejects the advice of "prefer composition over
inheritance" in that it specifically recommends a fairly steep inheritance
tree in order to present the capabilities of the pattern, even while making
reference to at least six other papers that reject the notion of inheritance
in favor of the decorator pattern for that particular use.
In addition, the pattern specifically applies to user agents. Unless you
are developing a system where the active behavior of an object is different
depending on the role that has been assigned to it, and the system is
involved in simulation-style activities (not part of your criteria), then
I'd say that this pattern is interesting, but not useful for your situation.
I'd also say that, were you developing for a system of this nature, then a
decorator pattern would be far more useful than a steep inheritance tree.
You mention that you believe that your problem is behaviorial:
> In a way it seems like a behavioural pattern since the role of the team
> member changes depending on certain attributes, however on the other
> end if additional attributes are needed to qualify the entity e.g. if
> the role were "Programmer" additional attrbutes could be needed to
> qualify "programmer" like UI Designer, Middleware Integrator etc., then
> it seems more like a structural pattern.
You used the word "if" to discuss the need for additional attributes which
leads me to believe that you do NOT have additional attributes depending on
roles. Therefore, it is a matter of assigning a role to a team member based
on attributes. However,the behavior of your system does not change based on
the assigned role. Therefore, the role attribute is simply a dependent
variable. It does not drive the availability of methods or change how the
object is available for interactions with other objects.
In fact, as I pointed out earlier, the attribute of the "role" of an
individual in your system is not even assigned to the member. It is
assigned to the relationship between a member and a team. As I mentioned
before, the Builder pattern is useful for situations where data is read and
interpreted during the construction of a tree of objects. This is still the
only pattern I see in your description.
Do you have constraints that you have not shared?
--
--- Nick Malik [Microsoft]
MCSD, CFPS, Certified Scrummaster
http://blogs.msdn.com/nickmalik
Disclaimer: Opinions expressed in this forum are my own, and not
representative of my employer.
I do not answer questions on behalf of my employer. I'm just a
programmer helping programmers.
--
.
- References:
- Patterns Question
- From: danths
- Re: Patterns Question
- From: Nick Malik [Microsoft]
- Re: Patterns Question
- From: danths
- Patterns Question
- Prev by Date: Composites
- Next by Date: Re: The Agile-Oriented Paradigm (AgOP)
- Previous by thread: Re: Patterns Question
- Next by thread: Visitor and Observer combined?
- Index(es):
Relevant Pages
|