Click here to Skip to main content
15,919,931 members
Home / Discussions / Design and Architecture
   

Design and Architecture

 
GeneralRe: Toilet Seats and Oven Doors Pin
Chris-Kaiser13-Apr-07 10:32
Chris-Kaiser13-Apr-07 10:32 
General[Message Deleted] Pin
#12313-Apr-07 10:45
#12313-Apr-07 10:45 
GeneralRe: Toilet Seats and Oven Doors Pin
Chris-Kaiser13-Apr-07 10:54
Chris-Kaiser13-Apr-07 10:54 
GeneralRe: Toilet Seats and Oven Doors Pin
Chris-Kaiser13-Apr-07 11:32
Chris-Kaiser13-Apr-07 11:32 
GeneralRe: Toilet Seats and Oven Doors Pin
Chris-Kaiser13-Apr-07 13:16
Chris-Kaiser13-Apr-07 13:16 
General[Message Deleted] Pin
#12313-Apr-07 15:33
#12313-Apr-07 15:33 
GeneralRe: Toilet Seats and Oven Doors Pin
Tristan Rhodes14-Apr-07 3:23
Tristan Rhodes14-Apr-07 3:23 
GeneralRe: Toilet Seats and Oven Doors Pin
Leslie Sanford14-Apr-07 6:56
Leslie Sanford14-Apr-07 6:56 
The Grand Negus wrote:
Not in the "pure" object approach invented and popularized by Alan Kay. His first pronouncement on the subject being: "Everything is an object."


A key component, maybe the component, of object oriented programming for Alan Kay was message passing. Keeping that in mind, let's look at your oven example:

The Grand Negus wrote:
The difference is that the procedural approach separates data and process: nouns over there, verbs over here. Cookies there, ovens there, baking something that the (implied) cook does with cookies and ovens here.

The object approach makes the processes part of the data: methods inside objects. Cookies there, ovens there, baking a method inside the cookie which somehow bakes itself. Or maybe inside the oven. Who knows? And what happened to the cook?


Well, my take on that would be that the aforementioned objects would send messages to each other. So we have an Oven that takes a Cookie. The Cookie is placed in the Oven by a Cook. The Cook sends a message to the Oven to bake at 350 degrees for 30 minutes. The Oven sends messages to the Cookie so that it changes as a result of the baking. When the Oven is done, it sends a message to the Cook that it is finished baking. And so on...

If I were implementing this in C#, I'd create an interface representing anything that can be baked; the Cookie class would implement this interface. That way the Oven doesn't have to know it's baking a Cookie, just that it has a "bakeable" object that it can send messages to.
GeneralRe: Toilet Seats and Oven Doors Pin
Chris-Kaiser16-Apr-07 9:10
Chris-Kaiser16-Apr-07 9:10 
GeneralRe: Toilet Seats and Oven Doors Pin
Chris-Kaiser16-Apr-07 11:08
Chris-Kaiser16-Apr-07 11:08 
GeneralRe: PS Pin
Pete O'Hanlon15-Apr-07 9:21
mvePete O'Hanlon15-Apr-07 9:21 
GeneralRe: PS Pin
Leslie Sanford15-Apr-07 14:15
Leslie Sanford15-Apr-07 14:15 
GeneralRe: PS Pin
Pete O'Hanlon15-Apr-07 22:56
mvePete O'Hanlon15-Apr-07 22:56 
GeneralRe: Toilet Seats and Oven Doors Pin
Chris-Kaiser16-Apr-07 9:01
Chris-Kaiser16-Apr-07 9:01 
GeneralRe: Toilet Seats and Oven Doors Pin
led mike16-Apr-07 4:45
led mike16-Apr-07 4:45 
General[Message Deleted] Pin
#12316-Apr-07 5:15
#12316-Apr-07 5:15 
GeneralRe: Toilet Seats and Oven Doors Pin
led mike16-Apr-07 5:40
led mike16-Apr-07 5:40 
GeneralRe: Toilet Seats and Oven Doors Pin
led mike16-Apr-07 8:15
led mike16-Apr-07 8:15 
GeneralRe: Toilet Seats and Oven Doors Pin
led mike16-Apr-07 8:50
led mike16-Apr-07 8:50 
GeneralRe: Toilet Seats and Oven Doors Pin
Dave Kreskowiak16-Apr-07 9:30
mveDave Kreskowiak16-Apr-07 9:30 
General[Message Deleted] Pin
#12316-Apr-07 9:57
#12316-Apr-07 9:57 
GeneralRe: Toilet Seats and Oven Doors Pin
Dave Kreskowiak16-Apr-07 10:10
mveDave Kreskowiak16-Apr-07 10:10 
GeneralRe: Toilet Seats and Oven Doors Pin
led mike16-Apr-07 10:44
led mike16-Apr-07 10:44 
GeneralRe: Toilet Seats and Oven Doors Pin
Chris-Kaiser16-Apr-07 11:09
Chris-Kaiser16-Apr-07 11:09 
GeneralRe: Toilet Seats and Oven Doors Pin
Chris-Kaiser16-Apr-07 9:21
Chris-Kaiser16-Apr-07 9:21 

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.