Lecture 1 Introduction to Information Systems

Download Report

Transcript Lecture 1 Introduction to Information Systems

Lecture 13 Object-Oriented Analysis -II

MIS541A University of Arizona

Topics

  Key ideas behind OO……… Use–cases..

MIS541A University of Arizona

Key ideas behind the Object Model..

•Abstraction…..

•Encapsulation •Modularity •Hierarchy •Typing •Concurrency •Persistence ALL OO MODELS MUST REFLECT THESE CHARACTERISTICS…

MIS541A University of Arizona

ABSTRACTION Focus on essential properties of the “real world” for the system…..Dependent on observer..Pick and choose..Objects capture those properties..Entity abstractions..Actions…etc…..

MIS541A University of Arizona

ENCAPSULATION……..

How an object is implemented is irrelevant ..Users of the object only need to know what it does..and how it can be used..(not its internals..)..Reuse……..

MIS541A University of Arizona

Encapsulation/Hiding

The object encapsulates only via both data and the logical procedures required to manipulate the data method # 1 Methods……..

data method # 2 Controlled access method # 6 method # 5 method # 4 Achieves “information hiding”

MIS541A University of Arizona

MODULARITY A collection of objects with some common theme or purpose…Easy for maintenance and use..Partitions into physical groups…

MIS541A University of Arizona

HIERARCHY……..

MIS541A University of Arizona

Helps in ordering and managing abstractions…….

Single & Multiple inheritance..

Is-a versus part of..

TYPING Type enforces physical rules…..of combining objects..substitution etc..

MIS541A University of Arizona

CONCURRENCY Multiple processes running at the same time ..I.e. multiple objects are active at the same time..things happen in parallel……(unless they need to access a common resource!)

MIS541A University of Arizona

PERSISTENCE Objects live through time……..and space…

MIS541A University of Arizona

OO Analysis

The process of defining the classes and interactions…… Usually done using what is called UML – The Unified Modeling Language… provides a series of diagrams… OO Analysis can be quite complex – tends to combine both programmers/domain analyst perspective… We will focus on data modeling, process modeling and state modeling……..

MIS541A University of Arizona

Advantages & Disadvantages of OOP

 Facilitates reuse  Allows for building complex systems  Perfomance issues - speed, memory  Managing large number of objects  May get very difficult to understand and debug  Notion of components - Encapsulated abstractions  Pluggability - a possibility - more work required

MIS541A University of Arizona

OO Languages & References

Smalltalk, Eiffel, Python, C++, Java www.bruceeckel.com

– Thinking in Java Introduction to OOP – Timothy Budd – www.cs.orst.edu/~cs582/slides Many books on OO and OO SW development Java Development Environment/UML – www.togethersoft.com

www.argouml.org

www.objecteering.com

Forte – www.forte.com

, Jbuilder – available at the Univ.

MIS541A University of Arizona

• • • •

Learning OO – Some guidelines for 541A.

Firstly, there are numerous aspects of OO, UML and variations on the same…I do not expect you to master the notation..You can always look up a book and see the notation..Focus on the underlying modeling idea…what is being said about the problem..

Develop skill to interpret somebody’s else diagrams..and also communicate your own notions..

Lectures are an overview of key ideas… Programming knowledge is not a reqmt..so I will stay away from those concepts…You can always take an OO programming course..

MIS541A University of Arizona

OOA- A Generic View

• • • • • • • • • • define use cases

(Requirements

) extract candidate classes (

Data modeling)

establish basic class relationships define a class hierarchy (

Data modeling

) identify attributes for each class (

Data modeling

) specify methods that service the attributes (

Process modeling)

indicate how classes/objects are related (

Process modeling)

build a behavioral model – State diagrams (

Behavioral modeling

) Illustrate workflows with Activity Diagrams Iterate

MIS541A University of Arizona

Togethersoft – An Intro!

Doing OO by hand can be cumbersome……….Good tools out there… Rational Rose/Togethersoft ArgoUML – not as sophisticated yet…….

MIS541A University of Arizona

UML Overview – Refer to the Textbook

Language for

 Visualizing systems  Specifying systems  Constructing systems  Documenting systems

Features

 Explicit model to facilitate communication  Graphical in nature  Well-define semantics unambiguous  Supports both forward and reverse engineering - round trip engineering

MIS541A University of Arizona

Views in UML

Design view

 

Process view Implementation view

view

Deployment Use case view

Vocabulary Functionality

Design view

System assembly Config. Mgmt

Implementation view

Behavior

Use case view Process view

Performance Scalability Throughput

Analysis

Deployment view

Topology Delivery Installaton

Unified view for all stages of the software development lifecycle..

MIS541A University of Arizona

Unified Modeling Language (UML)

User model view

. This view represents the system (product) from the user’s (called “actors” in UML) perspective.

Structural model view

. Data and functionality is viewed from inside the system. That is, static structure (classes, objects, and relationships) is modeled.

Behavioral model view

. This part of the analysis model represents the dynamic or behavioral aspects of the system.

Implementation model view

. The structural and behavioral aspects of the system are represented as they are to be built.

Environment model view

. The structural and behavioral aspects of the environment in which the system is to be implemented are represented.

MIS541A University of Arizona

UML Overview (Contd)

Building blocks

Things Relationships Diagrams

Structural Things

Classes Interfaces Collaborations Use cases Active classes Component Node

Behavioral Things

Interactions (messages) (action sequences) (links) States & state machines

Grouping Things

Packages Frameworks

Annotational Things

Notes Adornments

MIS541A

Dependency Association Generalization Realization Class diagrams Object diagrams Use case diagrams Sequence diagrams Collaboration diagram State charts Activity diagrams Component diagrams Deployment diagrams

Italics denote implementational Design related..

University of Arizona

HelloWorld Example

Import

java.awt.Graphics

class

Helloworld

extends public

java.applet.Applet { void paint (Graphics g) { g.drawString("Hello, World!",10,10); } } HelloWorld g.drawstring

("Hello, World!",10,10) Paint()

MIS541A University of Arizona

Applet

Class Relationships

HelloWorld Object ImageObserver Graphics Component Container Paint() Panel

MIS541A

Applet HelloWorld

University of Arizona Inheritance Hierarchy

Sequence diagram

Run :Thread Run :Toolkit :ComponentPeer CallbackLoop target:HelloWorld HandleExpos e Paint

MIS541A University of Arizona

HelloWorld Java Applet Awt

Packaging diagram

Hello.html

Lang HelloWorld.class

Component diagram MIS541A

Hello.jpg

University of Arizona

hello.java

Use Cases

   a scenario that describes a “thread of usage” for a system actors represent roles people or devices play as the system functions users can play a number of different roles for a given scenario

MIS541A University of Arizona

Banking System UseCase examples…………

MIS541A University of Arizona

Use cases

 Describes a set of sequences in which each sequence represents the interaction of things outside the system (its actors) with system itself  Involves the interaction of actors with a coherent set of roles and the systems  Actors - human and non human - major beneficiaries  A use case can have many variants  A use case carries out some tangible amount of work

MIS541A University of Arizona

Developing a Use Case

     What are the main tasks or functions that are performed by the actor?

What system information will the the actor acquire, produce or change?

Will the actor have to inform the system about changes in the external environment?

What information does the actor desire from the system?

Does the actor wish to be informed about unexpected changes?

MIS541A University of Arizona

Use cases (Contd.)

 Use cases and scenarios (like class & instances)  Use cases - what a system should do - Flow of events main flow and exceptions  Use cases implemented by a collaboration of classes many objects participate to execute a use case

MIS541A University of Arizona

Use case organisation

Use cases can be related via  Generalization  Inclusion  Extension Exhibit “relationships” similar to classes in general…..

MIS541A University of Arizona

Requirements & Use cases

 Establish the context of the system by identifying actors that surround it  For each actor, consider the behavior that each expects or requires of the system  Name these common behaviors as use cases  Factor common behavior into new use cases, factor variants, organise use cases  Model these use cases in Use-case diagrams  Adorn with notes as necessary

MIS541A University of Arizona

UML: Use-Case Diagram

MIS541A University of Arizona

Use case diagrams

A use case diagrams shows all the usecases and actors and their relationships Cellular Network Place phone call < > Receive phone call Use scheduler < > Place conf.

Call Receive additional call User

MIS541A University of Arizona