entity control & boundary classes

Upload: mahmoodabdul-rahman

Post on 08-Jul-2018

223 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/19/2019 Entity Control & Boundary Classes

    1/49

    Engr. Abdul-Rahman MahmoodMS, PMP, MCP, QMR(ISO9001:2000)

    [email protected] [email protected]

    alphapeeler.sf.net/pubkeys/pkey.htm http://alphapeeler.sourceforge.net

    pk.linkedin.com/in/armahmood http://alphapeeler.tumblr.com

    www.twitter.com/alphapeeler [email protected]

    www.facebook.com/alphapeeler [email protected]

    abdulmahmood-sss alphasecure mahmood_cubix 48660186

    [email protected] [email protected]

    http://alphapeeler.sf.net/me http://alphapeeler.sf.net/acms/

    VC++, VB, ASP

    Object Oriented Analysis &

    Design

    Teaching skills, Project Management

  • 8/19/2019 Entity Control & Boundary Classes

    2/49

  • 8/19/2019 Entity Control & Boundary Classes

    3/49

    Professor

    name

    empID

    create( )

    save( )

    delete( )

    change( )

    Class Name

    Attributes

    Operations

    Review: Class Recall, a class is an abstraction Describes a group of objects with common:

    Properties (attributes) Behavior (operations) Relationships Semantics

     A class is an abstraction in that it Emphasizes relevant characteristics; suppresses others Consists of the three sections indicated

    First section: Class name

    Second section: structure (attributes)

    Third section: behavior (operations)

    For analysis classes, these entries are sufficient!

  • 8/19/2019 Entity Control & Boundary Classes

    4/49

    Class Diagrams

    Sequence Diagrams

    Use Case

    Use

    -

    Case Model Design Model  

    Use Case Use

    -

    Case Realization

    Collaboration Diagrams

    Review: Use-Case Realization

    Not what we have so far.

    These are Design Classes. More later 

  • 8/19/2019 Entity Control & Boundary Classes

    5/49

    Review: Use-Case Realization Remember: a use-case realization describes

    how a particular use case is realized within the

    Design Model, in terms of collaborating objects.

     A use-case realization is one possible realization of

    a use case. A use-case realization in the Design Model can be

    traced to a use case in the Use-Case Model.

     A realization relationship is drawn from the use-case

    realization to the use case it realizes. A use-case realization can be represented using

    set of diagrams (the number and type may vary)

    Different organizations may have their own way

    of doing these things…(and naming them…)

  • 8/19/2019 Entity Control & Boundary Classes

    6/49

    Review: Use-Case Realization The diagrams that may be used to realize a use

    case realization may include:

    Interaction Diagrams (sequence and/or

    collaboration diagrams) can be used to describe

    how the use case is realized in terms of collaborating

    objects.

    These diagrams model the detailed collaborations

    of the use-case realization.

    Class Diagrams can be used to describe the classes

    that participate in the realization of the use case, as

    well as their supporting relationships.

    These diagrams model the context of the use-case

    realization.

  • 8/19/2019 Entity Control & Boundary Classes

    7/49

    Review: Use-Case Realization In our Use Case Analysis step, the use-case

    realizations' diagrams are outlined.

    Exactly what this entails will be discussed ahead and

    form part of the fourth deliverable.

    In subsequent design activities (Use-Case Design)these class diagrams will be considerably refined

    and updated according to more formal class

    interface definitions.

  • 8/19/2019 Entity Control & Boundary Classes

    8/49

     A designer: responsible for the integrity of the

    use-case realization. Must coordinate with the designers responsible

    for the classes and relationships employed in theuse-case realization.

    The use-case realization can be used by classdesigners to understand the class’s role in theuse case and how the class interacts with otherclasses. This implies that a team will/may distribute

    responsibilities for each class to developers.

    This information can be used to determine/refinethe class responsibilities and interfaces.

    Let’s find the classes from different behaviors theclasses must provide…

  • 8/19/2019 Entity Control & Boundary Classes

    9/49

    Identifying Candidate Classes from Behavior

     Will use three perspectives of the system to identify

    these classes. The ‘boundary’ between the system and its actors The information’ the system uses The ‘control logic’ of the system

     Will use stereotypes to represent these perspectives(boundary, control, entity) These are conveniences used during analysis that will

    disappear or be transitioned into different design elementsduring the design process.

     Will result in a more robust model because these are thethree things that are most likely to change in system andso we isolate them so that we can treat them separately. That is, the interface/boundary, the control, and the key

    system entities.….

  • 8/19/2019 Entity Control & Boundary Classes

    10/49

    Find Classes From Use-Case Behavior

    The complete behavior of a use case has to be

    distributed to analysis classes We must ‘identify’ these classes – identify, name,

    and briefly describe in a few sentences.

  • 8/19/2019 Entity Control & Boundary Classes

    11/49

    Discovering Classes Analysis classes represent an early conceptual model for

    ‘things in the system which have responsibilities andbehaviors’.

     Analysis classes are used to capture a ‘first-draft’, rough-cut of the object model of the system.

     Analysis classes handle primary functional requirements,

    interface requirements, and some control - and modelthese objects from the problem domain perspective.

  • 8/19/2019 Entity Control & Boundary Classes

    12/49

    Kinds of Analysis Classes Three things likely to change in a system:

    The boundary between the system and its actors(interfaces…)

    The information a system uses (data), and The control logic of the system (who does what)

    So, we isolate the different kinds of analysis classes Each of these has a set of canned duties &

    responsibilities  Again, the distinction between these classes is used in

    analysis but goes away in design or becomes less of anissue, as we transition these analysis classes into designartifacts / design entities to accommodate the problemdomain representations in a solutions space.

  • 8/19/2019 Entity Control & Boundary Classes

    13/49

    System

    boundary 

    Use-case

    behavior

    coordination

    Systeminformation

    What is an Analysis Class?Can use with the name of the stereotype

    In guillemets or as symbols with unique icons.

    Finding a candidate set of classes is the first

    part of transforming a mere statement of 

    required behavior to a description of how the

    System will work.

  • 8/19/2019 Entity Control & Boundary Classes

    14/49

    Analysis Classes - Early Conceptual Model

    The analysis classes, taken together, represent an early

    conceptual model of the system. This conceptual model evolves quickly and remains

    fluid for some time as different representations andtheir implications are explored.

     Analysis classes are early conjectures of the compositionof the system; they rarely survive intact intoimplementation.

    Many of the analysis classes morph into something elselater on (subsystems, components, split classes,

    combined classes). They provide us with a way of capturing the required

    behaviors in a form that we can use to explore thebehavior and composition of the system.

     Analysis classes allow us to "play" with the distributionof responsibilities, re-allocating, as necessary.

    A i C A Fi t St

  • 8/19/2019 Entity Control & Boundary Classes

    15/49

    Use Cases AnalysisClasses

    SourceCode

    ExecDesignElements

    Use-Case Analysis

    Ana ysis C asses: A First StepTowards Executables

    (…from a structural perspective; static)

  • 8/19/2019 Entity Control & Boundary Classes

    16/49

     Analysis class

     stereotype

    What is a Boundary Class? Insulates the system from changes in the outside Several Types of Boundary Classes

    User interface classes – classes that facilitatecommunication with human users of the system Menus, forms, etc. User interface classes….

    System interface classes – classes which facilitatecommunications with other systems.

    These boundary classes are responsible for managing thedialogue with the external system, like getting data froman existing database system or flat file…

    Provides an interface to that system for this system Device Interface Classes – provide an interface to devices

     which detect external events – like a sensor or … One boundary class per use case/actor pair

  • 8/19/2019 Entity Control & Boundary Classes

    17/49

    Customer 

    The Role of a Boundary Class

     A boundary class is a class used to model interaction between the system’s surroundings

    and its inner workings; Involves transforming and

    Boundary Classes model parts of the system that depend on its surroundings. Entity

    and control classes model parts that are independent of the system’s surroundings.

    Examples of boundary classes: Classes that handle GUI or communications protocols.

     Actors can only communicate with boundary classes.

    Boundary classes identify the system’s boundaries.

    External

    Database??

  • 8/19/2019 Entity Control & Boundary Classes

    18/49

    Boundary Classes - more Identify boundary classes for things mentioned in

    the flow of events of the use-case realization. Consider the source for all external events and

    make sure there is a way for the system to detecttheseevents. (user inputs/responses? Connection to

    existing external data…) One recommendation: for the initial identification

    of boundary classes is one boundar y class peractor/use-case pair. This class can be viewed as having responsibility for

    coordinating the interaction with the actor. This may be refined as a more detailed analysis is

    performed. This is particularly true for window-based GUI

    applications, where there is typically one boundary

    class for each window, or one for each dialog.

  • 8/19/2019 Entity Control & Boundary Classes

    19/49

    Course Catalog SystemRegister for CoursesStudent

    RegisterForCoursesForm

    CourseCatalogSystem

    Example: Finding Boundary Classes One boundary class per actor/use case pair:

    •The RegisterForCoursesForm contains a Student's "schedule-in-progress".

    It displays a list of Course Offerings for the current semester from which the

    Student may select to be added to his/her Schedule.

    •The CourseCatalogSystem interfaces with the legacy system that provides the

    complete catalog of all courses offered by the university.

    G id li B d Cl

  • 8/19/2019 Entity Control & Boundary Classes

    20/49

    Guidelines: Boundary Class –User Interface classes

    User Interface Classes

    Concentrate on what information is presented to the user Do NOT concentrate on the UI details Analysis Classes are meant to be a first cut at the abstraction

    of the system. The boundary classes may be used as ‘holding places’ for GUI

    classes. (Addressed in much more detail later) Do not do a GUI design in analysis, but isolate all

    environment-dependent behavior. (Likely you may be ableto reverse engineer a GUI component and tailor it.)

    The expansion, refinement and replacement of these

    boundary classes with actual user interface classes is avery important activity of Class Design – later  If prototyping the interface has been done, these screen

    dumps or sketches may be associated with a boundaryclass.

    Only model the key abstractions of the system – not everybutton, list, etc. in the GUI.

    G id li B d Cl

  • 8/19/2019 Entity Control & Boundary Classes

    21/49

    Guidelines: Boundary Classes –System and Device System and Device Interface Classes

    Concentrate on what protocols must be defined Note that your application must interface with an

    existing ‘information source.’ Do NOT concentrate on how the protocols will be

    implemented If the interface to an existing system or device is

    already well-defined, the boundary classresponsibilities should be derived directly fromthe interface definition.

    If there is a working communication with theexternal system or device, make note of it forlater reference during design.

  • 8/19/2019 Entity Control & Boundary Classes

    22/49

    Glossary

    Business-Domain Model

    Environment Independent 

     Analysis class

    stereotype

    Use Case

     Architectural Analysis

     Abstractions

    What is an Entity Class? (recall: boundary, entity,control…)

    Key abstractions of the system

    Entity classes show the

    logical data structure,

    which will help us

    understand what thesystem is supposed to

    offer to its users.

    Sources for entity

    Classes:

    Glossary

    Use-Case Flow of

    Events

    Business domain

    model

  • 8/19/2019 Entity Control & Boundary Classes

    23/49

    Entity Classes Entity classes represent stores of information in the

    system

    They are typically used to represent the key concepts the

    system manages.

    Entity objects (instances of entity classes) are used to

    hold and update information about some phenomenon,such as an event, a person, or some real-life object.

    (Chapter advisor, memorabilia, university, student,

    correspondence_item, International_Secretary, …)

    They are usually persistent, having attributes andrelationships needed for a long period, sometimes for the

    life of the system.

    The main responsibilities of entity classes are to

    store and manage information in the system.

    Th R l f E tit Cl

  • 8/19/2019 Entity Control & Boundary Classes

    24/49

    Store and manage inform at ion in the system 

    Customer 

    The Role of an Entity Class

    The values of its attributes and relationships are often given by an actor.

    Entity objects are independent of the environment (actors)

    Entity objects can have complicated behavior;

    however, unlike other objects, this behavior 

    is strongly related to the phenomenon the entity

    object represents.

  • 8/19/2019 Entity Control & Boundary Classes

    25/49

    Example: Finding Entity Classes Use use-case flow of events as input

    Key abstractions of the use case Traditional, filtering nouns approach

    Underline noun clauses in the use-case flow of events Remove redundant candidates Remove vague candidates Remove actors (out of scope) Remove implementation constructs Remove attributes (save for later) Remove operations

    E l C did t E tit

  • 8/19/2019 Entity Control & Boundary Classes

    26/49

    Student

    CourseOffering

    Schedule

    Example: Candidate EntityClasses Register for Courses (Create Schedule)

     A specific offering for a course

    including days of week and times

    The courses a student has selected for current semester 

     A person enrolled in classes at the university

  • 8/19/2019 Entity Control & Boundary Classes

    27/49

    Candidate Entity Classes Sometimes there is a need to model information

    about an actor within the system. This is not the

    same as modeling the actor (actors are external.

    by definition). These classes are sometimes

    called “surrogates”. For example, a course registration system

    maintains information about the student which is

    independent of the fact that the student also

    plays a role as an actor of the system. This information about the student that is stored in a

    ‘Student’ class is completely independent of the ‘actor’

    role the student plays; the Student class (entity) will

    exist whether or not the student is an actor to the

  • 8/19/2019 Entity Control & Boundary Classes

    28/49

    • Entity class :

    – Persistent data

    (used multiple times and in many UCs)

    – Still exists after the UC terminates (e.g. DB storage)

    • Boundary class: – (User) interface between actors and the system

    – E.g. a Form, a Window (Pane)

    • Control class: – Encapsulates business functionality 

    • Proposed in RUP (Rational Unified Process)

    Analysis Classes

  • 8/19/2019 Entity Control & Boundary Classes

    29/49

    9-29 © Prentice Hall, 2007

  • 8/19/2019 Entity Control & Boundary Classes

    30/49

    9-30 © Prentice Hall, 2007

  • 8/19/2019 Entity Control & Boundary Classes

    31/49

    9-31 © Prentice Hall, 2007

    What Is an Analysis Class? A class that represents initial data and behavior

    requirements, and whose software and hardware-oriented details have not been specified

     Analysis class diagram – a UML diagram showing

    analysis classes and their relationships

  • 8/19/2019 Entity Control & Boundary Classes

    32/49

    9-32 © Prentice Hall, 2007

    Stereotypes of Analysis Classes

    Mostly

    corresponds toconceptual data

    model classes

    Encapsulates

    connectionsbetween actors

    and use cases

    Mostly performs

    behaviorsassociated with

    inner workings of

    use cases

  • 8/19/2019 Entity Control & Boundary Classes

    33/49

    9-33 © Prentice Hall, 2007

  • 8/19/2019 Entity Control & Boundary Classes

    34/49

    9-34 © Prentice Hall, 2007

    What Is a Sequence Diagram?

     A UML diagram that shows the interactionbetween objects to perform critical pieces of usecase behavior in a time-ordered manner

    Interactions are in the form of messages

    Behavioral responsibilities are assigned to

    message recipients

  • 8/19/2019 Entity Control & Boundary Classes

    35/49

    9-35 © Prentice Hall, 2007

    Messages are passed between objects, and may contain parameters

  • 8/19/2019 Entity Control & Boundary Classes

    36/49

    9-36 © Prentice Hall, 2007

    Symbols in a Sequence Diagram

    Box or class stereotype symbol representsobjects.

    Dotted vertical line represents object’s lifetime.

    Thin bars represent focus of control, periods oftime when object is behaving (fulfillingresponsibilities).

    Labeled horizontal lines represent messagespassing between objects.

  • 8/19/2019 Entity Control & Boundary Classes

    37/49

    9-37 © Prentice Hall, 2007

  • 8/19/2019 Entity Control & Boundary Classes

    38/49

    9-38 © Prentice Hall, 2007

    Typically, actors interact with

    boundary classes, which inturn interact with control

    classes, which in turn interact

    with entity classes.

  • 8/19/2019 Entity Control & Boundary Classes

    39/49

    9-39 © Prentice Hall, 2007

    What Is Robustness Analysis?• Involves analyzing the narrative text of each of the use

    cases and identifying a first-guess set of the objectsinto entity, boundary, and control classes

    • Requires completeness checks and adherence todiagramming rules

  • 8/19/2019 Entity Control & Boundary Classes

    40/49

    9-40 © Prentice Hall, 2007

  • 8/19/2019 Entity Control & Boundary Classes

    41/49

    9-41 © Prentice Hall, 2007

    What Is a Communication Diagram? A UML diagram that shows the interactions between

    objects to perform critical pieces of the use casebehavior

    Unlike sequence diagrams, communication diagrams

    have no spatial representation of time; sequences ofmessages are shown by numbering.

  • 8/19/2019 Entity Control & Boundary Classes

    42/49

    9-42 © Prentice Hall, 2007

  • 8/19/2019 Entity Control & Boundary Classes

    43/49

    9-43 © Prentice Hall, 2007

    Drawing Analysis Class Diagrams•  Analysis classes are completed by including

    operations, which fulfill the responsibilities taken bythe analysis class.

    • In addition, attributes and relationships from theconceptual data model are retained and refined.

  • 8/19/2019 Entity Control & Boundary Classes

    44/49

    9-44 © Prentice Hall, 2007

    Operations (behaviors)

    are depicted in the

    lower third of a class

    box.

    Operations fulfill theclass’s responsibilities.

    EXAMPLE

  • 8/19/2019 Entity Control & Boundary Classes

    45/49

    EXAMPLE

    The UNIVERSITY OF BUTERE (UBT) registration system is

    briefly described thus:  You have been asked to streamline, improve, and automate

    the process of assigning professors to courses and theregistration of students such that it takes advantage of

    prevailing web technologies for on-line real time, locationindependent access.

    The process begins by professors deciding on which coursesthey will teach for the semester. The Registrar’s office thenenters the information into the computer system, allocatingtimes, room, and student population restrictions to eachcourse. A batch report is then printed for the professors toindicate which courses they will teach. A course catalogue isalso printed for distribution to students.

  • 8/19/2019 Entity Control & Boundary Classes

    46/49

    Students then select what courses they desire to take and

    indicate these by completing paper-based course advisingforms. They then meet with an academic advisor who

     verifies their eligibility to take the selected courses, that thesections of the courses selected are still open, and that the

    schedule of selected courses does not clash. The typicalstudent load is four courses. The advisor then approves thecourses and completed the course registration forms forthe student. These are then sent to the registrar who keysthem into the registration system – thereby formallyregistering a student. If courses selected are not approved,the student has to select other courses and complete thecourse advising forms afresh.

    EXAMPLE

  • 8/19/2019 Entity Control & Boundary Classes

    47/49

    Most times students get their first choice, however,in those cases where there is a conflict, theadvising office talks with the students to getadditional choices. Once all students have been

    successfully registered, a hard copy of the students’schedule is sent to the students for verification.Most student registrations are processed within a

     week, but some exceptional cases take up to two

     weeks to resolve.

    Once the initial registration period is over,professors receive a student roster for each classthe are scheduled to teach.

    EXAMPLE

  • 8/19/2019 Entity Control & Boundary Classes

    48/49

    Analysis Phase Class Diagram

  • 8/19/2019 Entity Control & Boundary Classes

    49/49

    DESIGN PHASE CLASS DIAGRAM