Click here to Skip to main content
15,891,136 members
Home / Discussions / Design and Architecture
   

Design and Architecture

 
AnswerRe: A tagging system (like html), support on the model please Pin
Quake2Player29-May-09 16:58
Quake2Player29-May-09 16:58 
QuestionParameters Pin
CodingYoshi29-May-09 7:11
CodingYoshi29-May-09 7:11 
AnswerRe: Parameters Pin
Luc Pattyn29-May-09 8:45
sitebuilderLuc Pattyn29-May-09 8:45 
Questionlooking for a design pattern Pin
NaNg1524129-May-09 3:38
NaNg1524129-May-09 3:38 
AnswerRe: looking for a design pattern Pin
CodingYoshi29-May-09 8:22
CodingYoshi29-May-09 8:22 
GeneralRe: looking for a design pattern Pin
NaNg1524129-May-09 11:27
NaNg1524129-May-09 11:27 
GeneralRe: looking for a design pattern Pin
CodingYoshi1-Jun-09 4:13
CodingYoshi1-Jun-09 4:13 
AnswerRe: looking for a design pattern Pin
Keld Ølykke8-Jun-09 23:30
Keld Ølykke8-Jun-09 23:30 
I would say you are looking for the Composite pattern: http://en.wikipedia.org/wiki/Composite_pattern[^].

With this pattern the quick solution is to make class A the composite and class B an component.

A more beautiful solution is to create an abstract Component class that just contains the functionality related to administering the tree data structure. You then create 2 implementations of this abstract class:
- class B that just re-uses the methods of the abstract class and adds its own functionality,
- class A that just re-uses the methods of the abstract class, but adds collection functionality and its own functionality.

A very beautiful solution is to separate specification from implementation:
- specify B's own functionality in an interface IB,
- specify A's own functionality in an interface IA,
- make an abstract class Component that contains child logic,
- make an abstract class Composite that contains collection logic,
- make a class B that inherits class Component and implements IB,
- make a class A that inherits class Composite and implements IA.
In the implementation of class B, you can now check, if the parent is of type IA, and then use the functionality of IA.
In the implementation of class A, you can now check, if a child is of type IB, and then use the functionality of IB.
You can even make interfaces for the Component and the Composite, if you go 100%.

Hope above was a little helpful. Remember, you decide your design!

Regards, Keld Ølykke
QuestionRequirements, SRS, Validation, Verification - - - - oh my god [modified] Pin
Frygreen24-May-09 6:39
Frygreen24-May-09 6:39 
AnswerRe: Requirements, SRS, Validation, Verification - - - - oh my god Pin
CodingYoshi27-May-09 3:23
CodingYoshi27-May-09 3:23 
AnswerRe: Requirements, SRS, Validation, Verification - - - - oh my god Pin
Robin_Roy23-Jul-09 16:11
Robin_Roy23-Jul-09 16:11 
GeneralRe: Requirements, SRS, Validation, Verification - - - - oh my god Pin
Frygreen24-Jul-09 9:15
Frygreen24-Jul-09 9:15 
GeneralRe: Requirements, SRS, Validation, Verification - - - - oh my god Pin
Robin_Roy26-Jul-09 17:40
Robin_Roy26-Jul-09 17:40 
GeneralRe: Requirements, SRS, Validation, Verification - - - - oh my god Pin
Frygreen27-Jul-09 7:42
Frygreen27-Jul-09 7:42 
GeneralRe: Requirements, SRS, Validation, Verification - - - - oh my god Pin
Robin_Roy27-Jul-09 16:43
Robin_Roy27-Jul-09 16:43 
GeneralRe: Requirements, SRS, Validation, Verification - - - - oh my god Pin
Frygreen7-Oct-09 6:45
Frygreen7-Oct-09 6:45 
QuestionSaving Business Objects Pin
CodingYoshi20-May-09 7:44
CodingYoshi20-May-09 7:44 
AnswerRe: Saving Business Objects Pin
Luc Pattyn20-May-09 8:22
sitebuilderLuc Pattyn20-May-09 8:22 
GeneralRe: Saving Business Objects Pin
CodingYoshi20-May-09 8:59
CodingYoshi20-May-09 8:59 
QuestionDeveloping a LMS software. Pin
RajpootRohan18-May-09 19:13
professionalRajpootRohan18-May-09 19:13 
AnswerRe: Developing a LMS software. Pin
riced18-May-09 22:51
riced18-May-09 22:51 
AnswerRe: Developing a LMS software. Pin
Robin_Roy23-Jul-09 16:31
Robin_Roy23-Jul-09 16:31 
GeneralRe: Developing a LMS software. Pin
ScottFrostX12-Aug-09 8:01
ScottFrostX12-Aug-09 8:01 
Questiondoes any body know about Brainstorming tool Pin
netJP12L13-May-09 7:36
netJP12L13-May-09 7:36 
AnswerRe: does any body know about Brainstorming tool Pin
scottgp13-May-09 8:30
professionalscottgp13-May-09 8:30 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.