1 / 5

business contracts

example. business contracts. Object-Oriented Problem Analysis. customer of each contract is a person or a company. Object-Oriented Implementation. the attribute „totalPrice“ will be implemented as a method.

eric-barber
Download Presentation

business contracts

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. example business contracts

  2. Object-Oriented Problem Analysis customer of each contract is a person or a company

  3. Object-Oriented Implementation the attribute „totalPrice“ will be implemented as a method there is no need to inherit Person and Company from some common superclass. In pure object-oriented database, they will be polymorphic only because of the same attributes they have.

  4. The Database Code doit UserGlobals at: #Customers put: Set new. UserGlobals at: #Contracts put: Set new. UserGlobals at: #Products put: Set new. % doit | pc1 pc2 pc3 cc1 cc2 x1 x2 x3 x4 x5 x6 x7 p1 p2 p3 p4 c1 c2 c3 c4 | pc2 := Person new. pc2 name: 'Peter'; surname: 'Green'; address: 'Easton'. … x1 customer: pc1; product: p1. x2 customer: pc1; product: p1. … p1 producer: c1. p2 producer: c2. … Customers add: pc1; add: pc2; add: pc3; add: cc1; add: cc2. Contracts add: x1; add: x2; add: x3; add: x4; add: x5; add: x6; add: x7. Products add: p1; add: p2; add: p3; add: p4. % commit

  5. Some Queries select all customers from Prague Customers select: {:c | c.address = 'Prague'} select all contracts with total price > 100 Contracts select: [:c | c totalPrice > 100] select all product producers of contracts with total price > 100 (Contracts select: [:c | c totalPrice > 100]) collect: [:c | c product producer] select all contracts related to product from Boston Contracts select: {:c | c.product.producer.address = 'Boston'}

More Related