This preview shows pages 1–3. Sign up to view the full content.
This preview has intentionally blurred sections. Sign up to view the full version.View Full Document
Unformatted text preview: Design Principles Goals of Software Design b Correctness o Satisfy the requirements for the application b Robustness o A design or implementation is able to handle miscellaneous and unusual conditions o Bad data, user error, programmer error and environmental conditions b Flexibility b Reusability b Efficiency o Create designs and implementations that are as fast as required and which make use of no more than the available memory b Reliability Key Concept: B Correctness Goal: That each artifact satisfies designated requirements, and that together they satisfy all of the applications requirements. Key Concept: B Correctness by Informal Methods Simplify and modularize designs until they convince. Sufficient Designs: Terminology and Rationale A design sufficient to implement the requirements. a correct design Sometimes called the design must be entirely understandable It follows that the design very modular A common way to achieve this is to make Minimum goal:-- with variables mileage , VehicleID , value , originalPrice , and type : 1) mileage > 0 2) mileage < 1000000 3) vehicleID has at least 8 characters 4) value >= -300 ($300 is the disposal cost of a worthless automobile) 5) originalPrice >= 0 6) ( type == REGULAR && value <= originalPrice ) || ( type == VINTAGE && value >= originalPrice ) Invariants for Class Automobile Key Concept: b Interfaces -- collections of function prototypes: Make designs more understandable. Introducing Interfaces 1 of 2 Shipment setVehicle() perishable() getWidth() printRoute() describeType() getLength() getDuration() setType() Introducing Interfaces 2 of 2 Shipment setVehicle() perishable() getWidth() printRoute() describeType() getLength() getDuration() setType() Shipment Dimensions getWidth() getLength() getWeight() TransportationMeans getDuration() setVehicle() printRoute() GoodsType describeType() setType() perishable() Shipment Dimensions TransportationMeans GoodsType Original form Forms using interfaces Package Interfaces Pricing purchases Furniture Clothing Appliance Selection ClothingTryout singleton PurchasesIF Domain vs. Non-Domain Classes B Domain classes : Particular to the application o Examples: BankCustomer, BankTransaction , Teller o Typically not GUI classes o Sufficient to classify all requirements (see chapter xx) B Non-Domain classes : Generic...
View Full Document
- Spring '10