rajanibhandari923
27,537 views
50 slides
Mar 10, 2014
Slide 1 of 50
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
About This Presentation
Give details about OOPS concept and Modeling concept "How to design system". Also it gives breif on layered architecture and reverse engineering.
Topics will be covered What is an Object What is Object Oriented Programming Why Modeling Required Modeling techniques Object Modeling Dynamic Modeling Functional Modeling Layered Architecture 2
What is Object Object : An object is a real life example of material thing which can be seen and felt. The object have specific behavior and attributes Example any real life thing. Some of them as follows Student Car Banking system Body Object can be categorized, described, organized, combined, manipulated and created. 3
Example of Objects 4 Book Title Author Publisher Open () Close() Read() Person Name Address Phone ChangeName () ChangeAddress () ChangePhone () Book Physics Book Biology Person 1 Ramesh Objects of Book or person Person 2 Suresh
What is Object Oriented Programming 5
Object Oriented Programming Four main object-oriented programming concepts. Data Abstraction Encapsulation Inheritance Polymorphism OOPS revolves around objects and classes Class may be seen as Structures and functions 6
7 Showing inheritance Specialization Abstract class Specialized class
Vehicle Example Showing inheritance generalization 8
Why Modeling Required 9
Why modeling Before constructing a building, a designer first build a model. To test a physical entity before actually building it. To set the stage for communication between customers and developers. For visualization i.e. for finding alternative representations. For reduction of complexity in order to understand it. 10
Why Model 11
Advantage of Modeling A model provides a means for conceptualization and communication of ideas in a precise and unambiguous form. A model is an abstraction for the purpose of understanding it before building it. So a model is an abstraction that hides the non-essential characteristics of a system and highlights those characteristics, which are pertinent to understand it. 12
Modeling Techniques 13
OMT stages and Models 14 Analysis - Model of real-world situation - What ? System Design - Overall architecture (sub-systems) Object Design - Refinement of Design - Algorithms/data structures to implement each class Implementation - Translation of object classes and relationships to a particular object-oriented language time System Object Model - Static structure of objects and their relationships (object diagram) Dynamic Model - Control aspects of the system (state diagrams) Functional Model - Data value transforamtions (dataflow diagrams)
Types of Model Object model The object model represents the static and most stable phenomena in the modeled domain. Main concepts are classes and associations , with attributes and operations . Aggregation and generalization (with multiple inheritance) are predefined relationships. Dynamic model The dynamic model represents a state/transition view on the model. Main concepts are states , transitions between states, and events to trigger transitions. Actions can be modeled as occurring within states. Functional model The functional model represents flow of values from external inputs, through operations and internal data stores, to external outputs. 15
Object Modeling 16
Object Modeling The object model provides the framework into which the other models are placed. Build an Object Model: Identify object classes. Develop a data dictionary for classes, attributes, and associations. Add associations between classes. Add attributes for objects and links. Organize and simplify object classes using inheritance. Group classes into modules, based on close coupling and related function. 17
Object and Class A class is defined as Collection of similar objects. It is a template where basic characteristics of set of objects is defined. Defines attributes and Operations i.e. member variables and functions. Defining a class does not define any object, but it only creates a template. For creating object basically create instance of class. 18
Association relation 19 Professor Ramesh Book Physics Wrote Department Science Courses Offers One to one relation Person Ramesh Passport 1 0..1 Airplane Passengers 1 * One to many relation Binary
Association relation with Qualifier 20 Bank Account No Person
Aggregation If two parts are linked but they have their individuality then its association and if two parts have whole-part relationship then it is aggregation. Like of whole is affected part will be affected 21
22 Document Paragraph Sentence Word Character Aggregation Example
Aggregation Example 23 ATM Cash Dispenser Deposit Slot PPT Slide
Modeling of Library System First we create object Model Identify class Identify its relationship Its attributes and behavior 24
Library System Class 27 Books User Publisher Librarian Student Faculty Reference Books General Books 0..* +1 Author 1 Issues Orders +1 +1…* Requests Manages +1 +1…*
Dynamic Modeling 28
Dynamic Model Build a Dynamic Model: Prepare scenarios of typical interaction sequences. Identify events between objects and prepare an event trace for each scenario. Prepare an event flow diagram for the system. Develop a state diagram for each class that has important dynamic behavior. Check for consistency and completeness of events shared among the state diagrams. 29
Identify Use Cases for library class 30 Inquiry for Membership Search Book Request for book issue Request for book return Pay Fine
Identify use case for library class 31 Issue member card Cancel membership Issue Book Return Book Maintain Book Record Update member card Update Book Remove Book Add Book
ATM define Class attributes and behaviour 32 Screen Display Message() Deposit Double: Amount Execute() Withdrawal Double: Amount Execute() Balance Enquiry Execute() Bank database Authenticate User() getBalance () Credit() Debit() Keypad GetInput () Transaction Int:Account Number Execute() getAccountNumber () Account Int : Account Number Int Pin Double:Balance validatePin () getBalance () Credit() Debit() Cash dipenser Int : amount DispenseCash () IsCashAvailable ()
Define classes attributes and Behavior 33 Book ID: Int Name: Char Author: Char Year of Publication : Char Price: Char Status: Char Char: Category Add New Books() Delete Books () UpdateBookDetails () DisplayBookDetails () UpdateStatus () Librarian ID: Int Name: Char IssueBooks () ReturnBooks () SearchBooks () VerifyMember () PayBills () OrderBooks () IssueIDCards () ManageBookReecord Publisher Int :Publisher ID Char : Publisher Name Char : Publisher Address Int: Publisher No. AddPub () ModifyPub () DeletePub () OrderStatus () User Int :User ID Char : User Name Char : User Address Int: Phone No. IssueBooks () ReturnBooks () PayFine () AddNewUser () DeleteUser () UpdateDetails ()
ATM state machine 34
State Machine 35 Issued Issue process() Search Book() Book Can have following states: Available Issued Returned Missing Request [Book Available] Cancelled Request
36 Member Librarian Book Issue Book [status == true] Search Book Book Found Set Status SetStatus Issued(book iD ) Book Issued Sequence Model
Function Modeling 37
Functional Modeling Build a Functional Model: Identify input and output values. Use data flow diagrams as needed to show functional dependencies. Describe what each function does. Identify constraints. Specify optimization criteria. 38
Function Modeling Data Flow Diagrams are composed of the four basic symbols – external entities, processes, data stores and data flow - as discussed below. The External Entity symbol represents sources of data to the system or destinations of data from the system. The Process symbol represents an activity that transforms or manipulates the data (combines, reorders , converts , etc.). The Data Store symbol represents data that is not moving (delayed data at rest). The Data Flow symbol represents movement of data. 39
DFD for issuing pay check 40 DFD for a system that pays to worker: Input Data Flow: Timesheet Hours(Source is Worker) Basic Output: Pay check Process: Employee's record is retrieved, using the employee ID, which is contained in the timesheet. From the employee record, the rate of payment and overtime are obtained.
Layered Architecture 41
Layered Architecture 42 UI layer (Forms or view displayed at front end ) Business Layer (Contains business logic) Data Layer (Manages DB, or File operation) DB File Send Reqeust Receive Response Set/Get Data Output Data/ reesponse
Advantages of Layered Architecture Reduced complexity Easy to add or modify functionality Easy to Debug and Test Increase Reusability 43
Reverse Engineering 44
Reverse Engineering 45 It is a technique to understand through analysis of its structure, Function and operation. The concept behind reverse-engineering—breaking something down in order to understand it, build a copy or improve it. It is easy to learn by putting things apart and rejoining that Helps in Estimate costs. Reverse Engg is done because documentation is not available
Forward vs Reverse Engineering 46 Analysis Design Implementation Reverse engineering Forward engineering Documentation Debugging is important factor in RE
Benefits for RE Understand existing design Quality improvement Software reuse No need to start from scratch To examin how product works , what components it consists , estimate costs. Reverse Engg is done because documentation is not available 47
Out Come of reverse engineering Document explaining: Code structure – classes, structures and its relation Functionality – Understanding functionality of module Input for Estimation Improvement points 48