Exforsys

Online Training

Design Pattern for implicit grouping

This is a discussion on Design Pattern for implicit grouping within the Software Patterns forums, part of the Testing category; Hi, In the context of simple OOP (C#): Given a collection of elements, I need an efficient way to tag ...


Go Back   Exforsys > Testing > Software Patterns

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 01-07-2005, 01:04 PM
Fernando Cacciola
Guest
 
Posts: n/a
Design Pattern for implicit grouping

Hi,

In the context of simple OOP (C#):

Given a collection of elements, I need an efficient way to tag each element
as belonging to a group.

I cannot explicitelly bag all these elements into a separate list (use
explicit grouping):
I need to keep them independent for most observers except those specifically
interested in their group structure.

Groups can be nested (here lies the complexity) so each observer must be
efficiently able to get the outmost group of each elements as well as the
entire group hierarchy.

I must be able to tie items (element or group) to form a new group; and to
untie a group at any nesting level.

I know this is not a difficult, but I wanted to know if there any existing
pattern for it.


P.S: Of course I can use explicit grouping and use something else to let
most of the system see it as a lineal collection... but unfortunately I
can't do that at this point becasuse of the involved changes.

TIA

Fernando Cacciola
SciSoft


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 01-08-2005, 09:03 AM
EventHelix.com
Guest
 
Posts: n/a
Re: Design Pattern for implicit grouping

You can declare group manager classes for each of the groupings
you need. Whenever a user is assigned to the linear list,
add it to the corresponding group manager classes.

If a user is removed from the linear list, remove it from all group
managers.

The following article might help:
http://www.eventhelix.com/RealtimeMa...ignPattern.htm

Deepa
--
http://www.EventHelix.com/EventStudio
EventStudio 2.5 - Automate sequence diagram generation

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 02:48 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.