Exforsys

Online Training

Design Pattern help for this scenerio?.

This is a discussion on Design Pattern help for this scenerio?. within the Software Patterns forums, part of the Testing category; I need some expert advice on possible ways to design the classes for following scenerio. Subject domain has 3 types ...


Go Back   Exforsys > Testing > Software Patterns

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 05-13-2004, 12:45 PM
KK
Guest
 
Posts: n/a
Design Pattern help for this scenerio?.

I need some expert advice on possible ways
to design the classes for following scenerio.

Subject domain has 3 types of identities.
Lets say <IDType1>, <IDType2>. Because
both are identities and have some
commonality we can inherit them from a
base <Identity> type.

Then there is People who owns those IDs.
Some have only 1 ID and some have both.

The problem I have having here is this.
You should be able to add <Identity>
only with a person. So, basicaly I thought
to have a register method inside <Person>
which inturn call [Add] methods in IDentites.

Also, I cannot have [Add] methods inside
the IDType1, IDType2 classes as public
because then it will allow adding identites
without adding a <Person>

Having Identities as inner classes within
<Person> will solve the above issue,
but then, to provide functionality such
as listing/searching IDType1, IDType2
will also have to be done from <Person>
which is a bit silly (I guess)

Any body who can help me
with some design pattern here?

Regards
KK
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 05-19-2004, 09:49 AM
Shashank
Guest
 
Posts: n/a
Re: Design Pattern help for this scenerio?.



KK wrote:

> I need some expert advice on possible ways
> to design the classes for following scenerio.
>
> Subject domain has 3 types of identities.
> Lets say <IDType1>, <IDType2>. Because
> both are identities and have some
> commonality we can inherit them from a
> base <Identity> type.
>
> Then there is People who owns those IDs.
> Some have only 1 ID and some have both.
>
> The problem I have having here is this.
> You should be able to add <Identity>
> only with a person. So, basicaly I thought
> to have a register method inside <Person>
> which inturn call [Add] methods in IDentites.
>
>


Why it should call add method on identity?


> Also, I cannot have [Add] methods inside
> the IDType1, IDType2 classes as public
> because then it will allow adding identites
> without adding a <Person>
>
>


add method on person that takes argument Identify.

> Having Identities as inner classes within
> <Person> will solve the above issue,
> but then, to provide functionality such
> as listing/searching IDType1, IDType2
> will also have to be done from <Person>
> which is a bit silly (I guess)
>
> Any body who can help me
> with some design pattern here?
>
>


Or I missed something?


> Regards
> KK


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 03:57 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.