Click here to Skip to main content
15,913,487 members
Home / Discussions / Design and Architecture
   

Design and Architecture

 
GeneralRe: Composition/Aggregation law of demeter Pin
DiiJAY7-Mar-10 22:06
DiiJAY7-Mar-10 22:06 
GeneralRe: Composition/Aggregation law of demeter Pin
Graham Breach7-Mar-10 23:42
Graham Breach7-Mar-10 23:42 
GeneralRe: Composition/Aggregation law of demeter Pin
Jonathan Davies8-Mar-10 1:10
Jonathan Davies8-Mar-10 1:10 
AnswerRe: Composition/Aggregation law of demeter Pin
Pete O'Hanlon8-Mar-10 1:36
mvePete O'Hanlon8-Mar-10 1:36 
AnswerRe: Composition/Aggregation law of demeter Pin
DiiJAY8-Mar-10 6:08
DiiJAY8-Mar-10 6:08 
GeneralRe: Composition/Aggregation law of demeter Pin
Jonathan Davies8-Mar-10 6:26
Jonathan Davies8-Mar-10 6:26 
GeneralRe: Composition/Aggregation law of demeter Pin
DiiJAY8-Mar-10 6:47
DiiJAY8-Mar-10 6:47 
GeneralRe: Composition/Aggregation law of demeter Pin
Jonathan Davies8-Mar-10 7:22
Jonathan Davies8-Mar-10 7:22 
DiiJAY wrote:
Ok, So it will be a benefit to make nested classes private and create extra code for wrapper methods and events in the main class for this sort of architecture instead of make a direct connection to the Cpu object?

Yes. Using Computer.Motherboard.Cpu.IsOverheated() means the calling code has to know about not only Computer class but also the the Motherboard and Cpu classes as well. Using just Computer.CpuIsOverheated() means the caller doesn't know about, or care, how the temperature is obtained internally.
As an example of the benefit, if you upgraded your PC with a motherboard that had 4 parallel CPUs the call to Computer.CpuIsOverheated() will still work from the caller's perspective. Internally the new motherboard code might average out the temperature of the 4 CPUs but this internal change is hidden from the caller. With this upgrade the Computer.Motherboard.Cpu.IsOverheated(); call runs into problems: Which of the 4 CPUs does this call refer to?

DiiJAY wrote:
will this even be true if I referenced Motherboard and Cpu as interfaces ?

Interfaces I use to refer to a set of related methods, if you wanted the temperature of, say, a Car, Room and a PC an ITemperature interface with a ITemperature.GetTemp() method would be handy but you would still want to hide your Motherboard and Cpu classes for the reasons already mentioned.
GeneralRe: Composition/Aggregation law of demeter Pin
DiiJAY8-Mar-10 9:26
DiiJAY8-Mar-10 9:26 
GeneralRe: Composition/Aggregation law of demeter Pin
Jonathan Davies8-Mar-10 10:01
Jonathan Davies8-Mar-10 10:01 
GeneralRe: Composition/Aggregation law of demeter Pin
David Skelly8-Mar-10 22:24
David Skelly8-Mar-10 22:24 
GeneralRe: Composition/Aggregation law of demeter [modified] Pin
Jonathan Davies8-Mar-10 23:35
Jonathan Davies8-Mar-10 23:35 
QuestionWhat do you think? Pin
Megidolaon5-Mar-10 9:02
Megidolaon5-Mar-10 9:02 
AnswerRe: What do you think? Pin
Pete O'Hanlon5-Mar-10 10:24
mvePete O'Hanlon5-Mar-10 10:24 
AnswerRe: What do you think? Pin
Jonathan Davies8-Mar-10 1:25
Jonathan Davies8-Mar-10 1:25 
QuestionWhat is System Architecture Diagram Pin
meeram39524-Feb-10 21:48
meeram39524-Feb-10 21:48 
AnswerRe: What is System Architecture Diagram Pin
R. Giskard Reventlov24-Feb-10 22:05
R. Giskard Reventlov24-Feb-10 22:05 
QuestionEnterprise Application Blocks for .Net Pin
meeram39522-Feb-10 22:09
meeram39522-Feb-10 22:09 
AnswerRe: Enterprise Application Blocks for .Net Pin
Richard MacCutchan22-Feb-10 22:36
mveRichard MacCutchan22-Feb-10 22:36 
QuestionInternet Firewall Pin
Abhirami vijayan21-Feb-10 18:32
Abhirami vijayan21-Feb-10 18:32 
AnswerRe: Internet Firewall Pin
Richard MacCutchan21-Feb-10 22:03
mveRichard MacCutchan21-Feb-10 22:03 
QuestionSystem life cycle help Pin
venomation12-Feb-10 1:58
venomation12-Feb-10 1:58 
AnswerRe: System life cycle help Pin
venomation7-May-10 16:58
venomation7-May-10 16:58 
QuestionFree UML Tools for download and install Pin
meeram3957-Feb-10 22:59
meeram3957-Feb-10 22:59 
AnswerRe: Free UML Tools for download and install Pin
Pete O'Hanlon7-Feb-10 23:24
mvePete O'Hanlon7-Feb-10 23:24 

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.