OO PedagogicalApproach

Uploaded from authorPOINTLite
Views:
 
Category: Entertainment
     
 

Presentation Description

No description available.

Comments

Presentation Transcript

Where do programming languages come from?: 

Where do programming languages come from? Where do programming languages come from? ”Dad, where do the programming languages come from?” ”They come from God, my boy” ”How do they come down to us, Dad?” ”God has created something wonderful called ”inspiration”, and uses that to bring a language into the minds of some nice and bright people called ”language designers”. They write it down so that we may read it and learn it.” ”Dad, why has God made such strange rules for parameters?” ”Don’t trouble your brain with such difficult questions. He always has a deeper meaning with what he does. Read the language manual and learn it by heart!”

Mathematics: 

Mathematics Mathematics is about relations Relations between specified quantities, valid within specified domains x = a x = a+b Rules for transformation into other valid relations exist, as: x = x + a implies 0 = a Informatics is about processes Description of sequences of events (state transitions) in processes: x = x + a does not imply a = 0 and should instead be written x + a => x

Notation: Mathematics, BETA (98-08-11): 

Notation: Mathematics, BETA (98-08-11) Mathematics: y = x , y = F(x) Fortran: y = x , y = F(x) Algol and Simula used a different operator: y := x y := F(x) BETA emphasises that programs should describe processes, not relations: x => y , x => F => y Mathematics: y = Fn( F(n-1)(... F2( F1( x ) ).. ).).).).).).) BETA: (a,b) => T12 => T23 => ... => T(n-1)n => (x,y,z) In the 1950s it was natural to try to make programs look like mathematics (Fortran means Formula Translation)

The pedagogy: 

The pedagogy The pedagogics of OO In pedagogics, a well-known principle is that the basic concepts should be taught first. More difficult and composite concepts should come later, after the basic ones are understood and mastered. Object-oriented programming is intended to comprehend and organise complexity. Its basic concepts are objects, classes, inheritance, with objects having attributes, virtuals, and possibly action sequences (threads) that may run concurrently. Teaching object-oriented programming thus must begin with exposing students to complex situation that only may be mastered by understanding and using these concepts.

The Restaurant, main picture: 

The Restaurant, main picture

The Restaurant: Waiter!/1: 

The Restaurant: Waiter!/1

Slide8: 

”Waiter!” … ”Waiter!!”... ”Waiter!!!” ”Sorry. Not my table.” Restaurant:Waiter!/2

The Restaurant: Waiter!/3: 

How will these people describe their evening at Restaurant Objecta? Alternatives: ”We had a wonderful discussion about William Blake’s poetry.” ”A sadly dissapointing Chateau Brâne Cantenac. Two bottles of excellent Hermitage more than made up for it.” ”Laura is an extraordinarily intelligent woman. You can read it in her eyes while she listens to you.” Object-oriented programming is not suited to discussions about poetry, wines, women, men or gastronomy. The Restaurant: Waiter!/3

The Restaurant: Waiter!/4: 

Q: But what is OO then suited to describe? A: Systems. Q: What is a system? A: A system is something that you have decided to regard as a system. Q: What does it imply to regard something as a system? A: You regard it as a whole, consisting of components, each component has pro-perties and may interact with other components. The Restaurant: Waiter!/4 Object-oriented programming is not suited to discussions about poetry, wines, women or gastronomy. OK. A restaurant owner, a head-waiter, an architect, an infor-mation system designer will often regard something as a system. F.A.Q:

Slide11: 

”Waiter!” … ”Waiter!!”... ”Waiter!!!” ”Sorry. Not my table.” Restaurant:Waiter!/2

Slide12: 

”Waiter!” … ”Waiter!!” ”Sorry. Not my table.” What is ”a table”? What is a table?

Slide13: 

Who will be permitted to enter Restaurant Objecta?

J. P. Morgan IV’s visit at Objecta: 

J. P. Morgan IV’s visit at Objecta J. P. Morgan IV’s visit at Restaurant OBJECTA J. P. Morgan IV arrives every day (except weekends) at 17:00, and leaves 18:00. He has Table 2 reserved, and Peterson, his waiter, has made everything ready for him. He will drink one glass (after a smart deal: two glasses) of his special Armagnac 1942, drink Colombian coffee and smoke a (Cuban, don’t mention it) cigar. He is known for always carrying at least $ 1000 and a gun.

Slide15: 

James Smith’s visit at Restaurant Objecta James Smith was hilariously happy when the wonderful Venus Jones accepted his dinner invitation He had $ 117.35 to spend. When the (perhaps) naive Venus Jones read the menu, she exclaimed: ”They say that Russian caviar is fantastic with champagne!” James Smith did not have the guts to say ”no”. Now their waiter, Aku Aku from Easter Island, waits: the accumulated bill is $ 147.50. if funds<bill then negotiate else pay and leave James Smith’s visit at Objecta

Slide16: 

Attributes Objects are individual identified components having substance (material existence in our environment, on the substrate of our brain, on paper, in the memory of a computer).Properties of objects are called attributes. A reference is an attribute that indicates some object and its current state is called its referent. A quantity is attribute that may be observed and measured, the result being mapped upon a value set. The current state is called its value. An action part is an attribute specifying a sequence of transitions to be carried out by the object, and the current state is called its ongoing transition. A pattern attribute is is an attribute prescribing the common structure for a category of objects. The collection of an object’s pattern attributes is called its repertoire.

Basic qualities of processes: 

Basic qualities of processes Basic qualities of processes Substance Guests, waiters, gatekeepers, tables, chairs, menus, food, drinks, bills State References: My table, My waiter, successor (in queue) Quantities: Available money, food names, prices, smoker, finished OBS!Action part: object begin ... ... end object; Pattern attributes: Order Transition Seating, ordering, serving, eating, paying, negotiating Structure (permanent properties of the process)

Basic qualities of processes: 

Basic qualities of processes Basic qualities of processes Substance Guests, waiters, gatekeepers, tables, chairs, menus, food, drinks, bills State Available money, accum. amounts on bills, guest names, food names, prices, table numbers, reserved, smoker, finished, no. of guests, Transition Seating, ordering, serving, eating, paying, negotiating Structure

Slide19: 

The queue outside, with the doorman as gatekeeper The queue inside, with the headwaiter as gatekeeper The gatekeepers

Description of: J. P. Morgan IV/1(2000-05-25): 

GUEST 1: object begin text name (J. P. Morgan IV); amount funds ($ 1000.00), accum bill ($ 147,50); Boolean smoker (true), finished (false), reserved table (true) ref(table) my table (TABLE 2); ref(waiter) my waiter (PETERSON); procedure order begin .... end; if not reserved then begin enter(outside queue); wait end; enter(inside queue); wait; sit down at my table; attract ( my waiter); get menu; order drinks; wait(consider smart deal); drink; attract (my waiter); while not finished do begin order food; order drinks; wait (consider smart deal); eat and drink; if smoker then smoke; attract (my waiter) end; ask for check; wait (consider smart deal); if accum bill ≤ funds then pay else negotiate; leave end object; Description of: J. P. Morgan IV/1(2000-05-25) J. P. Morgan IV’s visit at Restaurant OBJECTA

Slide21: 

James Morgan IV’s visit at Restaurant OBJECTA Colour code: Structure, Substance, State, Transition, Comments GUEST 1: object begin text name (James Morgan IV); amount funds ($ 1000.00), accum bill ($ 147,50); Boolean smoker (true), finished (false), reserved table (true) ref(table) my table (TABLE 2); ref(waiter) my waiter (PETERSON); procedure order begin .... end; if not reserved then begin enter(outside queue); wait end; enter(inside queue); wait; sit down at my table; attract (my waiter); get menu; order drinks; wait(consider smart deal); drink; attract (my waiter); while not finished do begin order food; order drinks; wait (consider smart deal); eat and drink; if smoker then smoke; attract (my waiter) end; ask for check; wait (consider smart deal); if accum bill ≤ funds then pay else negotiate; leave end object; Description of: J. P, Morgan IV/2(2000-05-25)

Guest: James Smith (2000-05-25) : 

Guest: James Smith (2000-05-25) James Smith’s visit at Restaurant OBJECTA GUEST 9: object begin text name (JAMES SMITH); amount funds ($ 113.35), accum bill ($ 147,50); Boolean smoker (false), finished (false), reserved table (false) ref(table) my table (TABLE 6); ref(waiter) my waiter (AKUAKU); procedure order begin .... end; if not reserved then begin enter(outside queue); wait end; enter(inside queue); wait; sit down at my table; attract ( my waiter); get menu; order drinks; wait (admire Venus Jones); drink; attract (my waiter); while not finished do begin order food; order drinks; wait (admire Venus Jones); eat and drink; if smoker then smoke; attract (my waiter) end; ask for check; wait (nervously); if accum bill ≤ funds then pay else negotiate; leave end object; Description of: James Smith/1(2000-05-25)

Guests at Restaurant ”OBJECTA” (2000-05-25): 

Guests at Restaurant ”OBJECTA” (2000-05-25) class guest begin text name; amount funds, accum bill; Boolean smoker, finished, reserved table; ref(table) my table; ref(waiter) my waiter; procedure order begin .... end; if not reserved then begin enter(outside queue); wait end; enter(inside queue); wait; sit down at my table; attract ( my waiter); get menu; order drinks; wait; drink; attract (my waiter); while not finished do begin order food; order drinks; wait; eat and drink; if smoker then smoke; attract (my waiter) end; ask for check; wait; if accum bill ≤ funds then pay else negotiate; leave end class; Guests’ visit at Restaurant OBJECTA new guest (J. P. MORGAN IV, 1000.00, 0, true, false, true, none, none); new guest (JAMES SMITH, 113.35, 0, false, false, false, none, none); Structure, Substance, State,Transition, Comments

Slide24: 

Cashier in Restaurant ”OBJECTA” (2000-05-25)

Slide25: 

The hub of the money streams. Hopefully, the cash register model only reflect that the artist was in a nostalgic mood. Or that it is one of the modern gimmicks with a com- puter inside. Cashier” (2000-05-25)

Harbour as restaurant: 

Harbour as restaurant Guests (ships) waiting outside restaurant (harbour) Guest (ship) being tabled (berthed) Waiter (crane) Waiter (crane) Waiter (crane) Waiter (crane) Kitchen (warehouses delivering goods) Guests (ships) at tables (berths) Warehouses receiving goods Head waiter (harbour captain)

Basic qualities of processes: 

Basic qualities of processes Basic qualities of processes Substance Guests, waiters, tables, food - Ships, berths, cranes - Clerks, customers, waiting lines, accounts - Records, documents, files State No. of guests, prices, accum. amounts on bills - Largest free berth length, crane speed, crane max. load - Client waiting time, clerk’s average transaction time - Document’s arrival date, name of sender, department code Transition Seating, ordering, serving, eating, paying - Assigning berths, berthing, unloading, loading, leaving - Waiting, paying, receiving, informing - Classifying, filing, finding, sending Structure

Attributes of objects: 

Attributes of objects Attributes of objects (themselves having substance) Substance attributes Guests: Successor guests in waiting line, table unit, waiter, menu, food Waiters: Table units, orders, cashier,chef Ships: Berth, crane, containers Documents: Enclosures, sender, receiver State attributes Guests: Available money, accumulated bill, smoker/non-smoker, finished Waiters: No. of tables, busy/available, accum. tips Ships: Arrival time, length, cargo load Documents: Arrival date, security level, ref.no. Transition attributes Guests: Entering outside queue, waiting, waiting inside for table, getting attention and menu, ordering, waiting, eating, paying, leaving Waiters: Order cycle: Getting orders- informing kitchen - delivering food, presenting bill, collecting Ships: Arriving, berthing, unloading, loading, leaving Documents: Creation, sending, receiving, filing, updating

Reference: Substance state - 1 (2000-05-22): 

Reference: Substance state Scope Specifier + Block struct. Reference: Substance state - 1 (2000-05-22)

Reference: Substance state - 2 (2000-05-22): 

Reference: Substance state - 2 (2000-05-22) Reference: Substance state Scope Specifier + Block struct. internal

Slide31: 

Quantity: Measured value state Structure Designation State Integer Age Value Name, Identifier 34 Category: Type Scope Specifier + Block struct. Quantities/Measured state(2000-05-25)

Pattern: Structure state (2000-05-22): 

Pattern: Structure state (2000-05-22) Pattern: Structure state

Intercepting cattle herds (98-08-09): 

Intercepting cattle herds (98-08-09) Structural similarity between very diverse systems: Intercepting cattle herds by mobile milking machines (Introducing SIMULA 67 to UNIVAC’s civilian and military simulation groups in 1967)