Presentation is loading. Please wait.

Presentation is loading. Please wait.

CompSci 280 S Introduction to Software Development

Similar presentations


Presentation on theme: "CompSci 280 S Introduction to Software Development"— Presentation transcript:

1 CompSci 280 S2 2107 Introduction to Software Development
Design Principles

2 Today’s Agenda Topics: Reading: Introduction Quality Guidelines
Design Quality Fundamental Concepts Reading: Software Engineering 10th Edition, Ian Somerville Chapter 6: Architectural Design Software Engineering: A Practitioner’s Approach, 7/e by Roger S. Pressman Chapter 8: Design Concept Lecture11

3 1.Introduction Quality Guidelines
A design should exhibit an architecture that (1) has been created using recognizable architectural styles or patterns, (2) is composed of components that exhibit good design characteristics and (3) can be implemented in an evolutionary fashion For smaller systems, design can sometimes be developed linearly. A design should be modular; that is, the software should be logically partitioned into elements or subsystems A design should contain distinct representations of data, architecture, interfaces, and components. A design should lead to data structures that are appropriate for the classes to be implemented and are drawn from recognizable data patterns. Lecture11

4 1.Introduction Quality Guidelines
A design should lead to components that exhibit independent functional characteristics. A design should lead to interfaces that reduce the complexity of connections between components and with the external environment. A design should be represented using a notation that effectively communicates its meaning. Lecture11

5 1.Introduction Design Quality
Design quality is an elusive concept Quality depends on specific organizational priorities A “good” design may be the most efficient, the cheapest, the most maintainable, the most reliable, etc The attributes discussed here are concerned with the clarity and maintainability of the design Object-oriented decomposition considers the system as a set of objects Lecture11

6 2.Fundamental Concepts (Overview)
Abstraction — data, procedure, control Architecture — the overall structure of the software Separation of concerns — any complex problem can be more easily handled if it is subdivided into pieces Modularity — compartmentalization of data and function Information Hiding — controlled interfaces Functional independence — single-minded function and low coupling OO design concepts — concepts such as classes and objects, inheritance, polymorphism etc. Design Classes — provide design detail that will enable analysis classes to be implemented Lecture11

7 2.Design Concepts Data Abstraction
An abstraction is a view or representation of an entity that includes only the attributes of significance in a particular context. Abstraction is essential when working with complex systems. Complex Object Idealised Model Ignore Inessential Details door implemented as a data structure manufacturer model number type swing direction inserts lights number weight opening mechanism Instance variables: Names : String DateOfBirth : Date Methods: getSurname(): String getFirstname (): String getAge(): Integer setSurname(name: String): void Customer Lecture11

8 2.Design Concepts Separation of Concerns
Any complex problem can be more easily handled if it is subdivided into pieces that can each be solved and/or optimized independently A concern is a feature or behavior that is specified as part of the requirements model for the software By separating concerns into smaller, and therefore more manageable pieces, a problem takes less effort and time to solve Separate issues (break down large problems into pieces) and concentrate on one at a time Separate concerns into classes and methods Separate data from UI, and UI from application logic Lecture11

9 2.Design Concepts Modularity
Monolithic software (i.e., a large program composed of a single module) cannot be easily grasped by a software engineer. The number of control paths, span of reference, number of variables, and overall complexity would make understanding close to impossible. In almost all instances, you should break the design into many modules, hoping to make understanding easier and as a consequence, reduce the cost required to build the software. optimal number of modules cost of software number of modules module integration cost module development cost What is the "right" number of modules for a specific software design? Lecture11

10 2.Design Concepts Advantages of Modular Systems
Easier to understand: when dealing with a module the details of other modules can be ignored (separation of concerns) Modules can be developed & maintained independently Separation of work: different teams for different modules Independent testing of modules Modules can be reused in several systems Modules can be replaced by other modules with the same interface Isolation between modules can prevent failure in one module to cause failure in other modules Lecture11

11 2.Design Concepts Spaghetti Code vs. Modular System
Haphazard connections, probably grown over time No visible cohesive groups High coupling: high interaction between random parts Understand it all or nothing Modular System High cohesion within modules Low coupling between modules Modules can be understood separately Interaction between modules is well- understood and thoroughly specified 10 parts, 13 connections 10 parts, 13 connections, 3 modules Lecture11

12 2.Design Concepts Information Hiding
Hide information that does not need to be visible in order to use a class/module/program Too much information can be confusing: what is important for usage and what not? Too much information can lead to undesired dependencies If internals are visible & accessible, someone might use/change them (use something in an unintended manner) If internals are changed then external code that relies on them might not work anymore Allowing only restricted access gives us more flexibility Class/module/program can be (ex)changed without breaking other parts Many design decisions can be hidden and the system design can evolve without collapsing Lecture11

13 2.Design Concepts Information Hiding
module • algorithm controlled interface • data structure • details of external interface • resource allocation policy clients "secret" a specific design decision Lecture11

14 2.Design Concepts OO Design Concepts
Design classes Entity classes Boundary classes Controller classes Inheritance—all responsibilities of a superclass is immediately inherited by all subclasses Messages—stimulate some behavior to occur in the receiving object Polymorphism—a characteristic that greatly reduces the effort required to extend the design Lecture11

15 2.Design Concepts Design Classes
Analysis classes are refined during design to become entity classes Boundary classes are developed during design to create the interface (e.g., interactive screen or printed reports) that the user sees and interacts with as the software is used. Boundary classes are designed with the responsibility of managing the way entity objects are represented to users. Controller classes are designed to manage the creation or update of entity objects; the instantiation of boundary objects as they obtain information from entity objects; complex communication between sets of objects; validation of data communicated between objects or between the user and the application. Lecture11


Download ppt "CompSci 280 S Introduction to Software Development"

Similar presentations


Ads by Google