Object-Oriented Design

3y ago
23 Views
2 Downloads
174.24 KB
6 Pages
Last View : 1m ago
Last Download : 3m ago
Upload by : Mariam Herr
Transcription

Object-Oriented Design:CRC cards and design principles15-413: Introduction to Software EngineeringJonathan AldrichAnnouncements Iteration reports/plans due Wednesday You should already be working on last iteration 2 weeks, 12 hours/personFocus on quality assurance, final value to clients Please fill out faculty course evaluations I will supplement the university form with aanonymous Blackboard survey with more detailedquestionsWe appreciate your input! Next week Mon/Wed: present tool evaluation resultsWed (second half): review for exam Please send me what you’d like to cover!Friday: final exam28 November 20051

OO Design Challenge What classes should be in a system? What should each one do? How should they collaborate? Principles Hide things likely to changeMaximize cohesion Minimize coupling The data and operations of a class should all be relatedOften helpful to look at concepts from problem domainSimplify interactions between classes as much aspossibleProtect user from errorsIterate by considering alternative designs28 November 2005CRC Cards A lightweight collaborative design method Class, Responsibility, Collaboration Responsibilities: tasks to perform, data to trackCollaborations: other objects this object works withClass orations:28 November 20052

CRC Cards A lightweight collaborative design method Class, Responsibility, Collaboration Responsibilities: tasks to perform, data to trackCollaborations: other objects this object works withClass name:ShapeSuperclass:DrawableSubclasses:Circle, Rectange, Responsibilities:Collaborations:Knows location, sizePoint, BoundingBoxDraw self on canvasCanvasMove self28 November 2005CRC Cards A lightweight collaborative design method Class, Responsibility, Collaboration Responsibilities: tasks to perform, data to trackCollaborations: other objects this object works withClass ities:Collaborations:Knows drawablesDrawable, ListDraw selfDrawableDrawing operations28 November 20053

Serialization Framework Design Allow developers to use the frameworkto aid them in serializing data into a fileor databaseClass ities:Collaborations:Knows drawablesDrawable, ListDraw selfDrawableDrawing operations28 November 2005Refining CRC into a design How to go from CRC cards to OOinterfaces (e.g. UML)? Walk through scenarios Operations performed Communication between classes UML: Use case Sequence diagram Infer interface from operations in scenarios Iterate according to design criteria Design for changeCohesionCouplingRobustness to errors28 November 20054

Framework Design Issues Interfaces vs. classes Use interfaces when there are multipleimplementations, or when implementorsmay want to inherit code from elsewhere Use classes when there is useful code toinherit If both apply, provide an interface and anabstract class that implements it Correct extension Use final for all methods that are notspecifically intended for extension28 November 2005Framework Design Issues Correct framework use If possible, ensure that all constructorsresult in fully initialized object Don’t require calls to init or set methods later Check invariants on input and throwmeaningful error Better to increase usability even at cost ofperformance Use assert to make this efficient Use the type system Ensure type dependencies are captured ininterface types Parameterize where necessary28 November 20055

Framework Design Issues Prohibit illegal calls Hide methods clients shouldn’t be able to touch Hide internal objects Make the classes private, or just don’t return the instancefrom public methodsOrdering constraints Internal to frameworkOnly safe to call under certain conditions that othermethods checkNote: Java, C# make this hard because packages are flatIf method A returns an object needed for method B, thencan’t accidentally call B firstProvide read-only access to data structures thatclients shouldn’t modify directly28 November 20056

Object-Oriented Design: CRC cards and design principles 15-413: Introduction to Software Engineering Jonathan Aldrich 28 November 2005 Announcements Iteration reports/plans due Wednesday You should already be working on last iteration 2 weeks, 12 hours/person Focus on quality assurance, final value to clients

Related Documents:

method dispatch in different object-oriented programming languages. We also include an appendix on object-oriented programming languages, in which we consider the distinction between object-based and object-oriented programming languages and the evolution and notation and process of object-oriented analysis and design, start with Chapters 5 and 6;

Object Class: Independent Protection Layer Object: Safety Instrumented Function SIF-101 Compressor S/D Object: SIF-129 Tower feed S/D Event Data Diagnostics Bypasses Failures Incidences Activations Object Oriented - Functional Safety Object: PSV-134 Tower Object: LT-101 Object Class: Device Object: XS-145 Object: XV-137 Object: PSV-134 Object .

as object–oriented design. Object–oriented development approaches are best suited to projects that will imply systems using emerging object technologies to construct, manage, and assemble those objects into useful computer applications. Object oriented design is the continuation of object-oriented analysis,

Object oriented design methods emerged in the 1980s, and object oriented analysis methods emerged during the 1990s. In the early stage, object orientation was largely . and extensible system. Whole object oriented modeling is covered by using three kinds of models for a system description. These models are: object model,

object-oriented programming language is based on a kind of old object-oriented programming language. For example, though C language is an object-oriented programming language, it still retains the pointer which is complex but has strong function. But C# improved this problem. C# is a kind of pure object-oriented language.

Reusability, CK Metric, Object - Oriented. 1. INTRODUCTION Object oriented systems continue to share a major portion of software development and customer base for these systems is on the rise. This is because there are many advantages in taking the object oriented concept. The weakness though is that most object oriented systems tend to be .

Object built-in type, 9 Object constructor, 32 Object.create() method, 70 Object.defineProperties() method, 43–44 Object.defineProperty() method, 39–41, 52 Object.freeze() method, 47, 61 Object.getOwnPropertyDescriptor() method, 44 Object.getPrototypeOf() method, 55 Object.isExtensible() method, 45, 46 Object.isFrozen() method, 47 Object.isSealed() method, 46

2 Database System Concepts 8.3 Silberschatz, Korth and Sudarshan Object-Oriented Data Model! Loosely speaking, an object corresponds to an entity in the E- R model.! The object-oriented paradigm is based on encapsulating code and data related to an object into single unit.! The object-oriented data model is a logical data model (like