Analysis And Design - Masaryk University

2y ago
34 Views
2 Downloads
1.75 MB
65 Pages
Last View : 4d ago
Last Download : 3m ago
Upload by : Eli Jorgenson
Transcription

Analysis and DesignLecture 4Chapter 7 Design and implementation1

Outline Software analysis and design Structured vs. object-oriented methods Object-oriented analysis Objects and classes Finding analysis classesChapter 7 Design and implementation2

Software Analysis and DesignLecture 4/Part 1Chapter 7 Design and implementation3

Analysis, design and implementation Software development (i.e. analysis, design andimplementation) is the stage in the software engineeringprocess at which an executable software system isdeveloped. Software analysis, design and implementation areinvariably inter-leaved with blurred border in between. Software analysis is a creative activity in which you identifysoftware processes, entities (objects) and their relationships. Software design refines analytical models with implementationdetails. Implementation is the process of realizing the design as aprogram.Chapter 7 Design and implementation4

Build or buy In a wide range of domains, it is now possible to buy offthe-shelf systems (COTS) that can be adapted andtailored to the users’ requirements. For example, if you want to implement a medical records system,you can buy a package that is already used in hospitals. It canbe cheaper and faster to use this approach rather thandeveloping a system in a conventional programming language. When you develop an application in this way, the designprocess becomes concerned with how to use theconfiguration features of that system to deliver thesystem requirements.Chapter 7 Design and implementation5

Process stages There are a variety of different design processes thatdepend on the organization using the process. Common activities in these processes include: Define the context and modes of use of the system;Draft the system architecture;Identify the principal system processes and entities;Develop design models;Specify component/object interfaces;Finalize system architecture. Process illustrated here using a design for a wildernessweather station.Chapter 7 Design and implementation6

System context and interactions Understanding the relationships between the softwarethat is being designed and its external environment isessential for deciding how to provide the required systemfunctionality and how to structure the system tocommunicate with its environment. Understanding of the context also lets you establish theboundaries of the system. Setting the system boundarieshelps you decide what features are implemented in thesystem being designed and what features are in otherassociated systems.Chapter 7 Design and implementation7

Context and interaction models A system context model is a structural model thatdemonstrates the other systems in the environment ofthe system being developed. An interaction model is a dynamic model that shows howthe system interacts with its environment as it is used.Chapter 7 Design and implementation8

System context for the weather stationChapter 7 Design and implementation9

Weather station use casesChapter 7 Design and implementation10

Architectural design May start system analysis or finish system design, oftenboth. Represents the link between requirements specificationand analysis/design processes. Often carried out in parallel with specification activities. It involves identifying major system components andtheir communications. The weather station is composed of independentsubsystems that communicate by broadcastingmessages on a common infrastructure.Chapter 6 Architectural design11

High-level architecture of the weatherstationChapter 7 Design and implementation12

Architecture of data collection systemChapter 7 Design and implementation13

Architectural abstraction Architecture in the small (analysis) is concerned withthe architecture of individual programs. At this level, weare concerned with the way that an individual program isdecomposed into components. Architecture in the large (design) is concerned withthe architecture of complex enterprise systems thatinclude other systems, programs, and programcomponents. These enterprise systems are distributedover different computers, which may be owned andmanaged by different companies.Chapter 6 Architectural design14

Advantages of explicit architecture Stakeholder communication Architecture may be used as a focus of discussion by systemstakeholders. System analysis Means that analysis of whether the system can meet its nonfunctional requirements is possible. Large-scale reuse The architecture may be reusable across a range of systems Product-line architectures may be developed.Chapter 6 Architectural design15

Use of architectural models As a way of facilitating discussion about the systemanalysis and design A high-level architectural view of a system is useful forcommunication with system stakeholders and project planningbecause it is not cluttered with detail. Stakeholders can relate toit and understand an abstract view of the system. They can thendiscuss the system as a whole without being confused by detail. As a way of documenting an architecture that has beendesigned The aim here is to produce a complete system model that showsthe different components in a system, their interfaces and theirconnections.Chapter 6 Architectural design16

System analysis Identification of system entities (object classes in objectoriented analysis) playing the key roles in the system’sproblem domain, and their relationships. Distillation and documentation of key system processes. System analysis is a difficult creative activity. There is no'magic formula' for good analysis. It relies on the skill,experience and domain knowledge of system analysts. Object/relationships/processes identification is aniterative process. You are unlikely to get it right first time.Chapter 7 Design and implementation17

Weather station object classesChapter 7 Design and implementation18

Design models Design models refine analysis models with theinformation required to communicate and document theintended implementation of the system. Static models describe the static structure of the systemin terms of system entities and relationships. Dynamic models describe the dynamic interactionsbetween entities.Chapter 7 Design and implementation19

Examples of design models Subsystem models that show logical groupings ofobjects into coherent subsystems and interface design. Sequence models that show the sequence of objectinteractions. State machine models that show how individual objectschange their state in response to events. Other models include use-case models, aggregationmodels, generalisation models, etc.Chapter 7 Design and implementation20

Key points Software analysis and design are inter-leaved activities. The level ofdetail in the design depends on the type of system and whether youare using a plan-driven or agile approach. The process of analysis and design includes activities to design thesystem architecture, identify entities in the system, describe thedesign using different models and document the componentinterfaces. Software analysis is a creative activity in which you identify softwareprocesses, entities (objects) and their relationships. Software design refines analytical models with implementationdetails.Chapter 7 Design and implementation21

Structured vs. Object-Oriented MethodsLecture 4/Part 2 Strukturovaná analýza systémůby J. Ráček22

Fundamental views of software systems Function oriented view System as a set of interacting functions. Functionaltransformations based in processes, interconnected with dataand control flows. Data oriented view Searches for fundamental data structures in the system.Functional aspect of the system (i.e. data transformation) is lesssignificant. Object oriented view System as a set of interacting objects, encapsulating both thedata and operations performed on the data. Strukturovaná analýza systémůby J. Ráček23

Structured vs. object-oriented analysis Structured analysis Driven by the function oriented view, in synergy with dataoriented view, through the concept of functional decomposition. Object-oriented analysis Driven by the object oriented view. Strukturovaná analýza systémůby J. Ráček24

Structured analysis and design Divides a project on small, well defined activities anddefines the order and interaction of the activities. Using hierarchical graphical techniques, resulting in adetailed structured specification, which can beunderstood by both system engineers and users. Effective in project structuring to smaller parts, whichsimplifies time and effort estimates, deliverables controland project management as such. Aimed at increasing system quality. Strukturovaná analýza systémůby J. Ráček25

Functional decompositionSystemcontextLevel 0processesLevel 1processesBasic-processspecificationDatadictionary Strukturovaná analýza systémůby J. Ráček26

Structured methods DeMarco: Structured Analysis and System Specification(SASS) Gane-Sarson: Logical Modelling (LM) Yourdon: Modern Structured Analysis (YMSA) Concentrates on the data and control flow of system processesand sub-processes. Structured Systems Analysis and Design Method(SSADM) Physical design, logical process design and logical data design Strukturovaná analýza systémůby J. Ráček27

Core notations of structured methods Context diagram Models system boundary and environment. Data flow diagram (DFD) Models the system as a network of processes completingdesignated functions and accessing system data. Entity relationship diagram (ERD) Models system’s data. State diagram (STD) Models system states and actions guarding transitions from onestate to another. Strukturovaná analýza systémůby J. Ráček28

Examplary method (Gane-Sarson)1. Define system context and create initial system DFD.2. Draft initial data model (ERD).3. Analyze data entities and relationships into final ERD.4. Refine DFD according to the ERD data model (createlogical process model).5. Decompose logical process model into proceduralelements.6. Specify the details of each individual proceduralelement. Strukturovaná analýza systémůby J. Ráček29

Object-oriented analysis and design Software engineering approach that models a system asa group of interacting objects. Each object represents some entity of interest in thesystem being modeled, and is characterized by its class,its state (data elements), and its behavior. Various models can be created to show the staticstructure, dynamic behavior, and run-time deployment ofthese collaborating objects. There are a number of different methods, defining theordering of modeling activities. The modeling notationuses to be unified (UML).Chapter 7 Design and implementation30

Object-oriented methods Jim Rumbaugh: Object Modelling Technique (OMT) Coad-Yourdon: Method for Object-Oriented Analysis(OOA) Jacobson: Object-Oriented Software Engineering (OOSE) Kruchten et al.: Rational Unified Process (RUP) Risk-driven iterations, component-based, with continuous qualityverification and change management. Booch-Jacobson-Rumbaugh: Unified Process (UP) Simplified non-commercial version of RUP maintained by ObjectManagement Group (OMG).Chapter 7 Design and implementation31

UML notation for object-oriented methods External perspective Use case diagram Structural perspective Class diagram, Object diagram, Component diagram, Packagediagram, Deployment diagram, Composite structure diagram Interaction perspective Sequence diagram, Communication diagram, Interactionoverview diagram, Timing diagram Behavioral perspective Activity diagram, State diagramChapter 7 Design and implementation32

Examplary method (Unified Process,analysis and design excerpt)1. Requirements System boundary, actors and requirements modelling with UseCase diagram.2. Analysis Identification of analysis classes, relationships, inheritance andpolymorphism, and their documentation with a Class diagram.Use Case realization with Interaction and Activity diagrams.3. Design Design classes, interfaces and components, resulting in refinedClass diagrams and Component diagrams.Detailed Use Case realization with Interaction and Statediagrams.Chapter 7 Design and implementation33

Key points Structured methods System as a set of nested processes accessing system data. Object-oriented methods System as a set of interacting objects (functions and data).Structured analysisObject-oriented analysisSystem boundaryContext diagramUse case diagramFunctionalityData flow diagramActivity diagramInteraction diagramsDataEntity-relationship diagram Class diagramObject diagramControlState diagram Strukturovaná analýza systémůby J. RáčekState diagram34

Object-Oriented AnalysisLecture 4/Part 3 Clear View Training 2010 v2.635

Analysis - purpose Produce an Analysis Model of the system’s desiredbehaviour: This model should be a statement of what the system does nothow it does it We can think of the analysis model as a “first-cut” or “high level”design model It is in the language of the business In the Analysis Model we identify: Analysis classes Use-case realizations Clear View Training 2010 v2.636

Object-Oriented Analysis: Objects and ClassesLecture 4/Part 4 Clear View Training 2010 v2.637

What are objects? Objects consist of data and function packaged togetherin a reusable unit. Objects encapsulate data Every object is an instance of some class which definesthe common set of features (attributes and operations)shared by all of its instances. Objects have: Attribute values – the data part Operations – the behaviour part Clear View Training 2010 v2.638

All objects have Identity: Each object has its own unique identity and canbe accessed by a unique handle State: This is the actual data values stored in an objectat any point in time Behaviour: The set of operations that an object canperform Clear View Training 2010 v2.639

Encapsulation Data is hidden inside theobject. The only way toaccess the data is via oneof the operationsoperationsattribute valuesdeposit() This is encapsulation ordata hiding and it is a verypowerful idea. It leads tomore robust software andreusable code.number "1243"withdraw()owner "Jim Arlow"balance 300.00getOwner()setOwner()An Account Object Clear View Training 2010 v2.640

Messaging In OO systems, objects send messages to each other over links These messages cause an object to invoke an operationBank ObjectAccount Objectmessagewithdraw( 150.00 )the Bank object sends themessage “withdraw 150.00” toan Account object.the Account object responds byinvoking its withdraw operation. Thisoperation decrements the accountbalance by 150.00. Clear View Training 2010 v2.641

UML Object Syntaxobject identifier(must be ccount : AccountattributecompartmentaccountNumber : String "1234567"owner : String "Jim Arlow"balance : double 300.00attributenameattributetypevariants(N.B. we've omitted the attribute compartment)object andclass namejimsAccount : Accountobject nameonlyjimsAccountclass nameonly: Accountattributevaluean anonymous object All objects of a particular class have the same set of operations. They are not shownon the object diagram, they are shown on the class diagram (see later) Attribute types are often omitted to simplify the diagram Naming: object and attribute names in lowerCamelCase, class names in UpperCamelCase Clear View Training 2010 v2.642

What are classes? Every object is an instance of one class - the class describes the"type" of the object Classes allow us to model sets of objects that have the same set offeatures - a class acts as a template for objects: The class determines the structure (set of features) of all objects of thatclass All objects of a class must have the same set of operations, must havethe same attributes, but may have different attribute values Classification is one of the most important ways we have oforganising our view of the world Think of classes as being like:class Rubber stamps Cookie cuttersobject Clear View Training 2010 v2.643

Exercise - how many classes? Clear View Training 2010 v2.644

Classes and objects Objects are instances ofclassesAccountclass Instantiation is the creation ofnew instances of modelelements Most classes provide specialoperations called constructorsto create instances of thatclass. These operations haveclass-scope i.e. they belong tothe class itself rather than toobjects of the class We will see instantiation usedwith other modelling elementslater onaccountNumber : Stringowner : Stringbalance : :AccountilasAccount:AccountaccountNumber : "801"owner : "Jim"balance : 300.00accountNumber : "802"owner : "Fab"balance : 1000.00accountNumber : "803"owner : "Ila"balance : 310.00objectsobjects are instances of classes Clear View Training 2010 v2.645

UML class notationclass dornmentoperationcompartmenttagged valuesWindow{author Jim,status tested} size : Area (100,100)#visibility : Boolean false defaultSize: Rectangle#maximumSize : Rectangle-xptr : XWindow* create() hide() display( location : Point )-attachXWindow( xwin : XWindow*)initialvaluesclass scope (static)operation Classes are named in UpperCamelCase Use descriptive names that are nouns or noun phrases Avoid abbreviations! Clear View Training 2010 v2.646

Attribute compartmentvisibility name : type multiplicity initialValuemandatory Everything is optional except name initialValue is the value the attribute gets when objects of the classare instantiated Attributes are named in lowerCamelCase Use descriptive names that are nouns or noun phrases Avoid abbreviations Attributes may be prefixed with a stereotype and postfixed with a listof tagged values Clear View Training 2010 v2.647

VisibilitySymbol NameSemantics publicAny element that can access the class can access any of its featureswith public visibility-privateOnly operations within the class can access features with privatevisibility#protectedOnly operations within the class, or within children of the class, canaccess features with protected visibility packageAny element that is in the same package as the class, or in a nestedsubpackage, can access any of its features with package visibilityPersonDetails You may ignore visibility in analysis-name : String [2.*]-address : String [3]-emailAddress : String [0.1] In design, attributes usually have privatevisibility (encapsulation) Clear View Training 2010 v2.648

Multiplicity Multiplicity allows you to model collections of things [0.1] means an that the attribute may have the value nullPersonDetails-name : String [2.*]-address : String [3]-emailAddress : String [0.1]name is composed of 2 or more Stringsaddress is composed of 3 StringsemailAddress is composed of 1 String or nullmultiplicity expression Clear View Training 2010 v2.649

Operation compartmentoperation signaturevisibility name( direction parameterName: parameterType default, ) : returnTypeparameter list Operations are named lowerCamelCase Special symbols and abbreviations are avoided Operation names are usually a verb or verb phrasethere may bea commadelimited list ofreturn types r1, r2, rn Operations may have more than one returnType They can return multiple objects (see next slide) Operations may be prefixed with a stereotype and postfixed with alist of tagged values Clear View Training 2010 v2.650

Parameter directionparameterdirectionsemanticsinthe parameter is an input to the operation. It is not changed by theoperation. This is the defaultoutthe parameter serves as a repository for output from the operationinoutthe parameter is an input to the operation and it may be changed bythe operationreturnthe parameter is one of the return values of the operation. Analternative way of specifying return valuesexample of multiple return values:use in detailed design only!maxMin( in a: int, in b:int, return maxValue:int return minValue:int )max, min maxMin( 5, 10 ) Clear View Training 2010 v2.651

Scope There are two kinds of scope for attributes andoperations:BankAccount-accountNumber : int-count : int 0class scope(underlined) create( aNumber : int) getNumber() : int-incrementCount() getCount() : int Clear View Training 2010 v2.6instance scope(the default)52

Instance scope vs. class scopeinstance scopeclass scopeattributesoperationsBy default, attributes have instance scopeAttributes may be defined as class scopeEvery object of the class gets its own copy of theinstance scope attributesEvery object of the class shares the same, singlecopy of the class scope attributesEach object may therefore have different instancescope attribute valuesEach object will therefore have the same classscope attribute valuesBy default, operations have instance scopeOperations may be defined as class scopeEvery invocation of an instance scope operationapplies to a specific instance of the classInvocation of a class scope operation does notapply to any specific instance of the class –instead, you can think of class scope operationsas applying to the class itselfYou can’t invoke an instance scope operation unlessyou have an instance of the class available. Youcan’t use an instance scope operation of a class tocreate objects of that class, as you could nevercreate the first objectYou can invoke a class scope operation even ifthere is no instance of the class available – thisis ideal for object creation operationsscope determinesaccess Clear View Training2010 v2.653

Object construction How do we create instances of classes? Each class defines one or more class scope operationswhich are constructors. These operations create newinstances of the classBankAccountBankAccount create( aNumber : int ) BankAccount( aNumber : int )generic constructor nameJava/C standard Clear View Training 2010 v2.654

ClubMember class example Each ClubMember object has itsown copy of the attributemembershipNumber The numberOfMembersattribute exists only once and isshared by all instances of theClubMember class Suppose that in the createoperation we er : String-memberName : String-numberOfMembers : int 0 create( number : String, name : String ) getMembershipNumber() : String getMemberName() : String-incrementNumberOfMembers() decrementNumberOfMembers() getNumberOfMembers() : int What is the value of count whenwe have created 3 accountobjects? Clear View Training 2010 v2.655

Key points We have looked at objects and classes and examinedthe relationship between them We have explored the UML syntax for modelling classesincluding: Attributes Operations We have seen that scope controls access Attributes and operations are normally instance scope We can use class scope operations for constructor anddestructors Class scope attributes are shared by all objects of the class andare useful as counters Clear View Training 2010 v2.656

Object-Oriented Analysis: Finding Analysis ClassesLecture 4/Part 5 Clear View Training 2010 v2.657

What are Analysis classes? Analysis classes represent a crispabstraction in the problem domain They may ultimately be refined into oneor more design classes All classes in the Analysis modelshould be Analysis classes Analysis classes have: A very “high level” set of attributes.They indicate the attributes that thedesign classes might have. Operations that specify at a high levelthe key services that the class mustoffer. In Design, they will becomeactual, implementable, operations.class nameBankAccountattributesname : Stringaddressbalance : st() Analysis classes must map onto realworld business concepts Clear View Training 2010 v2.6We alwaysspecify attributetypes if weknow what theyare!58

What makes a good analysis class? Its name reflects its intent It is a crisp abstraction that models one specific elementof the problem domain It maps onto a clearly identifiable feature of the problem domain It has high cohesion Cohesion is the degree to which a class models a singleabstraction Cohesion is the degree to which the responsibilities of the classare semantically related It has low coupling Coupling is the degree to which one class depends on others Clear View Training 2010 v2.659

Rules of thumb 3 to 5 responsibilities per class Each class collaborates with others Beware many very small classesA responsibility is acontract or obligationof a class - it resolvesinto operations andattributes Beware few but very large classes Beware of “functoids” Beware of “omnipotent” classes Avoid deep inheritance trees Clear View Training 2010 v2.660

Finding classes Perform noun/verb analysis on documents: Nouns are candidate classes Verbs are candidate responsibilities Perform CRC card analysis A brainstorming technique using sticky notes Useful for brainstorming, Joint Application Development (JAD)and Rapid Application development (RAD) With both techniques, beware of spurious classes: Look for synonyms - different words that mean the same Look for homonyms - the same word meaning different things Look for "hidden" classes! Classes that don't appearasTrainingnounsor as cards Clear View2010 v2.661

Noun/verb analysis procedure Collect all of the relevant documentation Requirements documentUse casesProject GlossaryAnything else! Make a list of nouns and noun phrases These are candidate classes or attributes Make a list of verbs and verb phrases These are candidate responsibilities Tentatively assign attributes and responsibilities toclasses Clear View Training 2010 v2.662

CRC card procedureClass Name: BankAccountResponsibilities:things theclass doesMaintain balanceCollaborators:Bankthings theclass workswith Class, Responsibilities and Collaborators Separate information collection from information analysis Part 1: Brainstorm All ideas are good ideas in CRC analysis Never argue about something – write it down and analyse it later! Part 2: Analyse information - consolidate with noun/verb Clear View Training 2010 v2.663

Other sources of classes Physical objects Paperwork, forms etc. Be careful with this one – if the existing business process is verypoor, then the paperwork that supports it might be irrelevant Known interfaces to the outside world Conceptual entities that form a cohesive abstraction e.g.LoyaltyProgramme Clear View Training 2010 v2.664

Key points We’ve looked at what constitutes a well-formed analysisclass We have looked at two analysis techniques for findinganalysis classes: Noun verb analysis of use cases, requirements, glossary andother relevant documentation CRC analysis Clear View Training 2010 v2.665

Structured analysis Object-oriented analysis System boundary Context diagram Use case diagram Functionality Data flow diagram Activity diagram Interaction diagrams Data Entity-relationship diagram Class diagram Object diagram Control State diagram State diagram Structured methods System as a set of nested processes accessing system data.

Related Documents:

technical analysis can offer a more complete valuation, which can make the difference in executing profitable trades. For more detailed literature on technical analysis, two recommended textbooks are: Technical Analysis of the Financial Markets , John J. Murphy and Technical Analysis Explained , Martin J. Pring, 3 rd Edition.

Design of Digital Systems II Sequential Logic Design Principles (1) Moslem Amiri, Václav Přenosil Masaryk University Resource: "Digital Design: Principles & Practices" by John F. Wakerly . Introduction Logic circuits are classified into two types, .

https://crocs.fi.muni.cz @CRoCS_MUNI Marek Sýs syso@fi.muni.cz Centre for Research on Cryptography and Security, Masaryk University Joint work with: Petr Švenda, MatúšNemec, Dušan Klinec, Vasilios Mavroudis, Andrea Cerulli, Dan Cvrček, George Danesis, Peter Sekan, Rudolf Kvašnovský, David Formánek, David Komárek and Vashek Matyáš Analysis and use of

TEMPLATE 2 – GAP ANALYSIS - OVERVIEW Case number: 2018CZ317039 Name Organisation under review: Masaryk University – Faculty of Science Organisation’s contact details: Faculty of Science, Kotlarska 267/2, 611 37 Brno, Czech Republic T: 420 775 352 944, 420 549 49 1402 B

Present ICE Analysis in Environmental Document 54 Scoping Activities 55 ICE Analysis Analysis 56 ICE Analysis Conclusions 57 . Presenting the ICE Analysis 59 The ICE Analysis Presentation (Other Information) 60 Typical ICE Analysis Outline 61 ICE Analysis for Categorical Exclusions (CE) 62 STAGE III: Mitigation ICE Analysis Mitigation 47 .

Research Design: Financial Performance Analysis In this study, financial performance analysis will be used. The analysis is based on three types of analysis methods which are horizontal analysis, trend analysis and ratio analysis. All data analysis is based on the items on the financial statement. A financial statement is a written record

Design and Analysis Software v2 file used as a template to contain primary analysis and secondary analysis settings. This option can be used for the analysis of legacy EDS or SDS files when a specific set of primary and secondary analysis settings are needed. The primary and secondary analysis settings will be used when the analysis (-a) option .

STORMBREAKER AnthonyHorowitz FUNERALVOICES WHENTHEDOORBELLringsatthreeinthemorning itsnevergoodnews AlexRiderwaswoken , ' . bythefirstchime Hiseyesflickeredopen .