Software Design COSC 3351
Popular in Course
Popular in Chemistry
This 35 page Class Notes was uploaded by Lowell Harris on Saturday September 19, 2015. The Class Notes belongs to COSC 3351 at University of Houston taught by Edgar Gabriel in Fall. Since its upload, it has received 59 views. For similar materials see /class/208172/cosc-3351-university-of-houston in Chemistry at University of Houston.
Reviews for Software Design
Report this Material
What is Karma?
Karma is the currency of StudySoup.
You can buy or earn more Karma at anytime and redeem it for class notes, study guides, flashcards, and more!
Date Created: 09/19/15
pan COSC 3351 Software Design Software Design Methodology Edgar Gabriel Spring 2008 g 39 P TL Outline Causes of difficulties in software design Vehicles to overcome difficulties Various strategies to solve software design problems Understand the basic structure of software design methodologies cost 3351 Software Deslgn Edgar Gabriel i Causes for difficulties Complexity Number of internal states of large software projects orders of magnitude higher than hardware products Complex interactions between elements Basically no identicalrepetitive elements Abstracted to functionclasses gt high probability for errors in requirements and specifications gt high probability for miscommunication among team members cost 3351 Software Design Edgar Gabriel PSTL Causes for difficulties Conformity Software expected to conform to standards imposed by others eg Hardware Existing software eg Operating System Database Legislators Changeability No other complex product encounter such frequent changes as software Invisibility Did you know that the source code of your microwave is gt 200000 lines 0050 3351 Software Design Edgar Gabriel Type of design errors Incorrectness the design does not meet the requirements Inconsistency eg two design statements make conflicting assumptions about the functionality of a component Ambiguity eg the design specification can be interpreted multiple ways Inferiority the design does not address quality requirements adequately Examples inefficiencies inflexibilities cosc cam softwarenesigri Edgar Gabriel PSTL Vehicles to overcome difficulties Axioms for good design Separation of Concerns A complex problem can best be solved by devising intermediate solutions expressed in terms of simpler independent problems Comprehension the mind cannot manipulate more than seven two things at a time Translation A correct design that meets its interface and behavior specifications in one environment will continue to meet its specifications in another environment provided that the new environment provides equivalent services Transformation design correctness is unaffected by replacement of equivalent components cost 3351 Software Design Edgar Gabriel Basic rules for software design Modular design create units with loose interunit coupling Portable design employ abstract context interfaces Malleable design malleability can be achieved by modeling the endusers view of the external environment Conceptual integrity uniform application of a limited number of design forms Intellectual control recording design as increasingly detailed abstractions Visualization representing design in visual notations such as diagrams and figures cost 3351 Software Design Edgar Gabriel PSTL The context of design Eg in the V model Input functional specification and nonfunctional requirements as the result of the requirements analysis and functional specification phases Output design specification that describes software architecture and module design of the software components Similar steps for all other models 0050 3351 Software Design Edgar Gabriel i Stages of software design Architectural design Organization of the system as a composition of components Assignment of functionality to components Global control structures Protocols for communication synchronization and data access Physical distribution Scaling and performance Dimensions of evaluation Selection among alternatives Detailed design 0050 551 Software n EdgarGabnel PVSTL Design strategies I Decompositional methods Topdown approach Starts with the original description of the problem or model Decompose the problem into subproblems Solve the subproblems separately Compositional methods Starts by identifying a set of particular entities and objects involved in the problem Each entitiesobjects are described and grouped Define relationship between entities m cosczgregt nlarger components eslgn Edgar Gabriel i Design strategies II Design templates Many problems have a great deal of similarities Abstract similarities into templates Reuse proven design templates Incremental and evolutionary strategies Trialanderror a design solution for a carefully chosen subset of requirements Evaluate against other requirements Make modifications to meet other requirements while preserving the required properties that it already has satisfied cosc cam softwarenesigri Edgar Gabriel PSTL Popular Design Methods Jackson structured Programming JSP and Jackson System Development JSD Structured Methods eg SADT and SSADM Object oriented methods eg UML Various formal methods cost 3351 Software Design Edgar Gabriel PSTL I Jackson Structured Programming Structured programmmg baed on correpondence between data tream tructure and program tructure JSP tructure program and data m term o a r amentat uperatrurr Each program mput and output r modened a a eparate Data Structure Dragram DSD mput and Output Structure are merged mto a Program Structure Dragram PSD In af x mm PSTL I Jackson Structured Programming A rmpte operauon v drawn a a box A equence ofoperatvon v repreented by boxe connectedvmth tme eg A conrt of B c D In 5 quotaquot H PSTL I Jackson Structured Programming Ah vteratvon y repreXented AAth Jomed boxe m addvtvoh the vterated o eratvon ha a tar m the top hem comer El A etectvon y vmvtar to a equence butvmth a cvrde m the top hght corner eg A conmt ofevther B c or D In 13923quotquot quotquot W u PSTL I JSP example a runlength encoder hput a byte tream Output tream of pavr commung of a byte atong vmth a count of the byte comecutvve occurrence rm tep modet mbut e tream ur byte whvch can be vvewed a i eru Elf mare NH 7 Each run cumut ur me ur mure byte ufthe ame vatue In afg mn bequot Model output 7 Zeru urrhure pavr 7 each patrcuhttmg Ufa byte and n cuuht l 53th mm PSTL I JSP example a runlength encoder Demnbe the correwondence between the mput and the output In I JSP example a runlength encoder Merge the Lructure H P TL P5 JSP example a runlength encoder lnuzlude Gran hgt mum 3 ye char 3mm a e graham mm m e m 55 E e may 55 cm lt 255 caunzH Puncher fxxscibyb h pucnhar count mum mysuccxss Ill PSTL COSC 3351 Software Design Architectural Design I Edgar Gabriel Spring 2008 Edgar Gabriel If 7 V Ff Detailed break down of software design Architecture Design associates system capabilities identified in the requirements specification with the system components that will implement them Code Design involves algorithms data structures and components Executable design addresses code design at a lower level eg memory allocation data formats bit patterns etc 0050 3351 Software Design Edgar Gabriel Software Architectural Styles Software Architectural Style defines a family of systems in terms of patterns of structural organization Software Architectural Styles is determined by A set of component types A set of connectors define mechanisms for communication coordination and cooperation between components Topological structure A set of semantic constraints Ill gssgiiigfmmw Classification of Software PgTL Architectural Styles Main program and subroutine Call and Layered system Ob ect oriented return Data abstraction lt J Abstract data types Data Repository centered Blackboard Architectural styles 4 Client server Independent Communicating processes J Peer39tO39Peer components Event based implicit invocation Data flow Pipe and filter I BatCh sequential processmg Virtual Interpreter maChine Rule based system cost 3351 Software Design Edgar Gabriel Call and Return A software system is decomposed into subsystems Each component executes only when it gets control from another component and returns control to that component when it terminates execution During execution a component might pass control along to another component Each component has usually a fixed entry and one or more locations of exit Shared data that all components can access are called global variables cosc BM Softwareneslgn Edgar Gabriel PSTL Call and return II o A group of subroutines that share a common data store can be grouped to form a module Goal when creating modules High cohesion large number of intramodule connections Loose coupling few interconnections across the boundaries of modules Positive aspects Supports information hiding Supports code reuse Negative aspects Additional concepts required to deal with very large systems 0050 3351 Software Deslgn Edgar Gabriel PSTL Main program and subroutine Hierarchical call and return style main A E P 0050 BM Softwareneslgn Edgar Gabriel PSTL Layered system Subroutines are organized in a number of groupslayers Each layer provides a certain level of abstraction The implementation of each depends on calls to the subsystems in the lower layers Positive aspects Support designs based on incremental levels of abstractions Negative Not all systems are easily structured in a layered fashion cost 3351 Software Deslgn Edgar Gabriel Example for a layered system network protocols OSI model layers TCPIP protocol family 7 Application Application 4 Transport Tcp I UDp IPv4 IPv6 l Dataunk 1 Physical hardware cost BM Softwareneslgn 7 Edgar Gabriel PSTL Data abstraction Abstract data types allow to Encapsulate basic functionality into a single handle Can contain multiple basic data types eg a struct in C An abstract data type typically modified and accessed through operations defined on the abstract data type Objects extensions to abstract data types Representations of real world entities Can be classified into classes Support the concept of generalization and specialization The same method name may refer to different operations polymorphism State of the art for large scale systems 0050 3351 Software Deslgn Edgar Gabriel H P TL I Object oriented programming II I fune abjectwant Lu mteractwvth anuther abject u mun Knuw the abject r m cuntrary 2 g m vperandrmterdvscussed later 7 Changesufan abjectvdentm reqwescnangasau Ether abjectswmch cummumcate WYU V them ume abjectA me abject B and abject OM de err c B we ubject 7 3395 affects an a luuk m unexp m wsvble mm suurce Nvemurycunmmptmn I Ezi r mvu acted svde affects an A v 2 n nude P5TL I Object oriented programming III I L V v mzwmgt mum r Perfurmanceeg tepanuvg 39 a benchmark m wmwseg has me aquot t a creasmgly cumplex39 abject unwed features m cm mm xww Data centered Two types of components Data store contains the data accessed by other components shared data Clients execute operations on the shared data Eg separate threads run a client each Shared data is the means of communication between components Two substyles Repository a passive data store eg file Blackboard an active data repository eg notifying subscribers when data if interest changes cosc cam softwarenesigri Edgar Gabriel PSTL Independent components o Multiple components execute independently eg multiple applications processes and communicate through messages o One process candoes not control another process Eg a component can not control whether a message leads to an action in the other component o No shared variables or state between the components o Advantages Decoupling various portions of the problem gt increases reliability Disadvantages Interaction protocols between different processes required eg http for web based applications Impossibility of a distributed consensus cost 3351 Software Design Edgar Gabriel Eventbased 1mpl1c1t invocation sub style Individual components announce data they wish to share with their environment publishing Components register interest in that data subscribe A message manager event handler is responsible for keeping record on all components that registered for certain events Component Component Component C t Component Message manager omponen cosc BM Softwareneslgn Edgar Gabriel PSTL Communicating processes substyle Communication through channelsports Different communication mechanisms Synchronous vs asynchronous Onetoonepointtopoint vs Onetomanybroadcast Subsubstyles Clientserver Peertopeer cost 3351 Software Deslgn Edgar Gabriel i Clientserver A client process requests an action or service A server process responds to the process Popular examples The internet webserver vs browsers on user PCsclients You 05 certain services are offered by a daemon eg ssh daemon and used by clients ssh terminal Two subtypes Thick client parts of the logic of the software is installed in the client Thin client all logic of the software is installed on the server Egg cxi lsmwareneslgn 3 g PSTL Peertopeer Extension of the clientserver style No dedicated clients All processes can act as a server and as a client All processes might communicate with each other In clientserver architectures separate clients do not talk to each other Removes a potential bottleneck of CS Limited application scenarios Ownership issues Security problems Licensing issues 0050 3351 Software Deslgn Edgar Gabriel PSTL Data flow System is viewed as a series of transformations on successive pieces of input data Data enters the system and flows through the components one at a time until they reach a final destination Structure of the design is dominated by motion of data from one component to another Availability of data controls computation no global control of components behavior Components are highly independent cosc BM Softwareneslgn Edgar Gabriel PSTL Data flow example Database server Client E Web server HTML page generator cost 3351 Software Deslgn Edgar Gabriel i Pipeandfilter Substyle of Data flow Components are called filters connectors are called pipes in this model Filters must be independent entities Filters do not know the identity of their upstream or downstream filters Their specification might still restrict what appears on the input or make guarantees about the output The correctness of the output of a pipeandfilter network should not depend on the order in which the filters perform their incremental processing Eg assume that all filters are executing in parallel cosc BM Softwareneslgn Edgar Gabriel 1a PSTL Pipeandfilter Music noise Gender recognition and speech Telephonewideband Lexicon language acoustic models recognition models A A A Filter out Interactive 1 Acous c gt gt nonspeech gt Segmenting amp gt gt Audio analySIS recognition l signa segments labeling cost 3351 Software Deslgn Edgar Gabriel Batch sequential processing Substyle of Data flow One component runs to completion before the next starts Do not execute concurrently Data is transmitted between components as a whole rather than a stream of data elements cosc BM Softwareneslgn Edgar Gabriel PSTL Example compiler infrastructure Images LenaLvsia I Legtlt1cal I Error gt 9I I analysis I reporting IL Sequence I Syntax of tokens mgt analysis quotquotquot quot xquot 39 39 gt Tables If Parsing 39L COde quotquot39rquotquot I tree I generation I 39 quotquotquot quot39 1 39 39 b39bi zt39 quot quotquotquotquotquotquotquotquotquotquotquot quot I J Luquot Optimization 59l ITiquot Optimized object I I cost 3351 Software DesIng Edgar Gabriel In a PSTL COSC 3351 Software Design An Introduction to UML II Thvs lecture Bantams mammal frum mtg Ndn cudegaar cum awake31863 Edgar Gabrvel Sprmg 200B Packages dame can be grouped mto package HI USTL Sequence diagrams I A 5e uence diagram 1 an mteracuon dvagram that detale how operauon are earned out 77 what memge are ent an e Sequence dvagram are orgamzed accordmgto Lyme The Lyme progreme a you go down the page L wowed m the operauon are Med from left to ngm accordmg to when they take part m the memge equence Example course enrollment system Problem description Users must be able to view a menu of available courses and select a course Once selected a popup allows to enter name phone fax and email address User can select payment option check purchase order credit card Once all information is provided user has to click on submit button gt another screen pops up summarizing all information and instructs user to print sign and fax the copy Email is sent automatically to an Enrollment Clerk EC about the user and the subscription cosc BM Softwareneslgn 7 Edgar Gabriel PSTL Example course enrollment system II System knows maximum number of students for each class and marks classes as sold out if limit is reached EC can email all students enrolled in a course by bringing up a special form gt select course type message EC can bring up a form that shows status of all students for all courses that have already been taught Status will indicate whether student was attending and whether student has payed cost 3351 Software Deslgn Edgar Gabriel i Identifying Actors Enroller This actor enrolls a student in a course Enrollment Clerk This actor receives email notification of each enrollment It also sends email notices to students and receives reports about enrollments and payments Student This actor receives email notification of enrollment and email notifications from the Enrollment Clerk The student attends the courses it is enrolled in cosc cam softwarenesigri Edgar Gabriel PSTL Use case 1 Use case 1 View Menu of choices Enroller requests list of courses of choices System displays list of Cou rses En roller Included are name place time and cost of the course List will also show number of students allowed and currently enrolled cost 3351 Software Design Edgar Gabriel i Use case 2 Use case 2 Enroll in a course Enroller views menu of courses 39 ld Use case 1 ltf r5 f e Enroller selects course System prompts for name phone fax email address and Extension points fill out payment method preferred payment Extension point fill out Enroller l payment method Other use cases will be Student extending this use case Used whenever there are many EnrollmentClerk alternatives within a part 0050 3351 SoftwareDesIgn Edgar Gabriel PVSTL Use case 2 amp 3 Enroll in course o Use case 21 pay by purchase order o Use case 22 pay by check o Use case 23 pay by card extend o Use case 3 email messages to students Enrollment Clerk cost 3351 SoftwareDesIgn Student Edgar Gabriel Use case 4 Use case 4 set attendance Select a class and a student that is enrolled in that class attendance System presents student and Enmumenmerk shows whether the student attended the class and payment has been received cost 3351 Software Design Edgar Gabriel PVSTL Use case 5 o Get student status EC selects student Extension point select student of EnrollmentClerk lntereSt et student statu 0 Extension points Selectstudenis of interest Use case 51 select students in a course List all courses EC selects a course System shows all students in the extend course Use case 52 select unpaid students EC indicates that the system should Select students select all unpaid students in ca students U rse cost 3351 Software Design Edgar Gabriel pan System Boundary Diagram Enroller Student cost 3351 Software Deslgn Edgar Gabriel e View Menu 1 of choices l ltltincludegtgti Enroll in j course Email msgs to student Set attendance et studen status 7Enrollment Clerk Do Show key objects wi relationships software to be built UML allows to subs stereotypes eg y 0050 3351 Software Deslgn Edgar Gabriel PSTL main model Set of diagrams that help to define the terms that appear in the use cases descriptive tool thin the problem and their The domain model is not necessarily the model of the We will depict domain models using the type stereotype in the class diagrams titute different icons for different ou could represent a domain model as a cloud to clearly distinguish them from classes Domain Model I o 1 Abstraction The course catalog List of courses that are offered type Course Catalog PSTL ltlttypegtgt Course Fee Currenc Add Course Remove Course Enrollment limit integer Current enrollment integer Problem with this abstraction the same model could be offered multiple times at different locations Need to separate the course from the schedule date location instructor 9quot cost 3351 Software Des Edgar Gabriel Ill ltlttypegtgt Course Catalog Domain Model II type Course Add Course Remove Course type Session Schedule Fee Currenc l teaches PSTL type Session Add Session Remove Session cost 3351 Software Design Edgar Gabriel Session date Current enrollment Add Student Remove Student offers Enrollment limit integer schedules 039 enrolled in inS 39LIC r n type Student Paid b Attended bool What we ve learned from the domain model Use cases employ the wrong language Course catalog and courses have to be replaced in the use cases by session schedules and session Some use cases have been left out Need to maintain Course Catalog and Session Schedule Courses and Sessions need to be added and removed from Course CatalogsSession Schedules Creating the Domain Model helps us understand the problem cost 3351 Software Design Edgar Gabriel Deciding the Architecture Software Platform Choices A Webbased CGI application A database application Visual XYZ Write everything from scratch in C o gt we choose CGI for this case case 3351 Software Design Edgar Gabriel Web architecture Need to decide on the number of webpages what CGI scripts shall be invoked etc cgi gtgt tmlgtgt Session Menu quotquotquotquotquotquotquotquotquot quot Session Menu Generator dePequotd5 cost 3351 Software Design Edgar Gabriel PSTL Web Architecture II cost 3351 Software Design Edgar Gabriel PSTL Database Interface Layer Each CGI program must have access to the data representing students classes schedules etc We call it the training database To keep the access independent of a particular data base we introduce a Database Interface Layer DIL Training Training DIL Training Application depends depends Database 0050 BM Softwareneslgn Edgar Gabriel PSTL Database Interface Classes within the training application need to access the database This will be accomplished through a set of interfaces inside the Training Application Interfaces are implemented by classes in the DIL package cost 3351 Software Deslgn Edgar Gabriel interface interface interface GetourseNamestring Getostfloat realizes DIL SESSiOn SChEdUle Session DIL Course cosc 3351 5ortwarenesigri 7 Edgar Gabriel PSTL Session Menu Generator Corresponds to the 1St use case Goal Build an HTML representation of a session schedule Merge an HTML template with the actual data from a session schedule Program will use the SessionSchedule interface to access Session and Course instances in the database in order to get names times locations and fees cost 3351 Software Design Edgar Gabriel cost 3351 Software Deslgn Edgar Gabriel Sess39 n Schedule Ge essionlterahor GetNeXt Session GeKourE PSTL Course
Are you sure you want to buy this material for
You're already Subscribed!
Looks like you've already subscribed to StudySoup, you won't need to purchase another subscription to get this material. To access this material simply click 'View Full Document'