Click here to Skip to main content
15,889,877 members
Home / Discussions / Design and Architecture
   

Design and Architecture

 
AnswerRe: Simple composition - Your thoughts? Pin
Nagy Vilmos14-May-12 23:38
professionalNagy Vilmos14-May-12 23:38 
GeneralRe: Simple composition - Your thoughts? Pin
Eytukan14-May-12 23:43
Eytukan14-May-12 23:43 
AnswerRe: Simple composition - Your thoughts? Pin
Pete O'Hanlon14-May-12 23:48
mvePete O'Hanlon14-May-12 23:48 
GeneralRe: Simple composition - Your thoughts? Pin
Nagy Vilmos15-May-12 1:25
professionalNagy Vilmos15-May-12 1:25 
GeneralRe: Simple composition - Your thoughts? Pin
Pete O'Hanlon15-May-12 1:56
mvePete O'Hanlon15-May-12 1:56 
GeneralRe: Simple composition - Your thoughts? Pin
Eytukan15-May-12 4:36
Eytukan15-May-12 4:36 
GeneralRe: Simple composition - Your thoughts? Pin
Pete O'Hanlon15-May-12 4:53
mvePete O'Hanlon15-May-12 4:53 
AnswerRe: Simple composition - Your thoughts? Pin
BobJanova15-May-12 0:46
BobJanova15-May-12 0:46 
As Pete says, a constructor should always return a valid object, that is, you should be able to use it in normal situations. So the answer to the question depends on whether a Rocket can be useful without a Booster. In your simplistic example, where it has one method and that method throws an exception if it isn't set, it clearly can't, and therefore the Booster should be assigned in the constructor (and, if applicable, a null check applied there).
AnswerRe: Simple composition - Your thoughts? Pin
Marc Clifton15-May-12 1:51
mvaMarc Clifton15-May-12 1:51 
GeneralRe: Simple composition - Your thoughts? Pin
Pete O'Hanlon15-May-12 1:57
mvePete O'Hanlon15-May-12 1:57 
GeneralRe: Simple composition - Your thoughts? Pin
Marc Clifton15-May-12 2:45
mvaMarc Clifton15-May-12 2:45 
GeneralRe: Simple composition - Your thoughts? Pin
Pete O'Hanlon15-May-12 3:25
mvePete O'Hanlon15-May-12 3:25 
GeneralRe: Simple composition - Your thoughts? Pin
Marc Clifton15-May-12 4:57
mvaMarc Clifton15-May-12 4:57 
GeneralRe: Simple composition - Your thoughts? Pin
Eytukan15-May-12 4:41
Eytukan15-May-12 4:41 
GeneralRe: Simple composition - Your thoughts? Pin
Marc Clifton15-May-12 5:06
mvaMarc Clifton15-May-12 5:06 
GeneralRe: Simple composition - Your thoughts? Pin
Eytukan15-May-12 18:32
Eytukan15-May-12 18:32 
QuestionDatabase Modeling - Conditional Relationships Pin
Leslie Sanford11-May-12 8:34
Leslie Sanford11-May-12 8:34 
AnswerRe: Database Modeling - Conditional Relationships Pin
R. Giskard Reventlov11-May-12 9:49
R. Giskard Reventlov11-May-12 9:49 
GeneralRe: Database Modeling - Conditional Relationships Pin
Leslie Sanford12-May-12 8:42
Leslie Sanford12-May-12 8:42 
AnswerRe: Database Modeling - Conditional Relationships Pin
Eddy Vluggen13-May-12 4:32
professionalEddy Vluggen13-May-12 4:32 
AnswerRe: Database Modeling - Conditional Relationships Pin
jschell14-May-12 9:24
jschell14-May-12 9:24 
Questionhow to design base class? Pin
wan.rui@qq.com10-May-12 17:09
wan.rui@qq.com10-May-12 17:09 
AnswerRe: how to design base class? Pin
walterhevedeich10-May-12 19:29
professionalwalterhevedeich10-May-12 19:29 
AnswerRe: how to design base class? PinPopular
Pete O'Hanlon10-May-12 21:52
mvePete O'Hanlon10-May-12 21:52 
GeneralRe: how to design base class? Pin
wan.rui@qq.com10-May-12 22:11
wan.rui@qq.com10-May-12 22:11 

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.