2 Data-flow Diagram(DFD) IEEE defines DFD (also known as bubble or work flow diagram) as,‘a diagram that depicts data sources, data sinks, data storage, and processes performed on the data as nodes, and logical flow of data as links between the nodes’Data flow diagram (DFD) is a picture of the movement of data between external entities and the processes and data stores within a system
3 Objective of DFDIs to provide an overview of the transformation that occurs in the input data within the system in order to produce an output
4 DFD Symbols) Process Data Flow Data Store Source/Sink (External Entity)
5 Process Work or actions performed on data (inside the system) Labels should be verb phrasesReceives input data and produces output
6 Rule 1: ProcessCan have more than one outgoing data flow or more than one incoming data flow
8 Data FlowRepresents the movement of data from its source to destination within the systemArrows depicts movement of data
9 Data Store Is used in a DFD to represent data that the system stores Labels should be noun phrases
10 Rule: Data StoreMust have at least one incoming and one outgoing data flow
11 Source/Sink (External Entity) External entity that is origin or destination of data (outside the system)Labels should be noun phrasesSource – Entity that supplies data to the systemSink – Entity that receives data from the system
12 Rules for Using DFD Symbols Data Flow That ConnectsYESNOA process to another processA process to an external entityA process to a data storeAn external entity to another external entityAn external entity to a data storeA data store to another data storeA data store to an external entity
13 Directions to be followed while constructing dfd Identify the major inputs and outputsStarting from the inputs, work toward the outputs, identify the major transforms in the way.Procedural information like loops and decisions not be shown in the DFDLabel each component properlyNever try to show the control logic. If we find thinking in terms of loops and decisions, it is time to stop and start again.Each process should be numbered uniquely, but the numbering should be consistent
14 …continueA DFD should be organized in a series of levels so that each level provides more detail than the previous levelA DFD should be refined until each process performs simple functionsThe name of the process should be carried to the next level of DFD
15 Various levels of DFD Level 0 DFD (Context diagram) : Shows an overall view of the system.It should depict the system as a single bubble.All external entity interacting with the system should be represented in this diagramLevel 1 DFD : This elaborates level 0 DFD and splits the process in to detailed formLevel 2 DFD : This elaborates level 1 DFD and displays the process(s) in to more detailed form
16 Example 1: RMS Calculating Software A software system called RMS calculating software reads three integral numbers from the user in the range between and and determines the root mean square of the 3 i/p numbers and then displays it:accept the input numbers from the user,validate the numbers,calculate the root mean square of the input numbers,display the result.
17 Example 1: RMS Calculating Software Compute- RMS 0Data-itemsUserresultContext Diagram
23 A XYZ college offers many courses to the students A XYZ college offers many courses to the students. A students submits the application specifying the name of the course, if the seats are available then the admission is granted other wise it is rejected.
28 Data DictionaryIt is an organized listing of all data elements that are pertinent to the system, so that both user and system analyst will have a common understanding of inputs, outputs, components of stores and even the intermediate calculations.It is a repository that contains descriptions of alldata objects concerned or produced by the software
29 Some terminologies related to DD are Data Element : Data element is the smallest unit of data that has some meaning. E.g. part code.Data Structure: is a group of data elements that describe a unit in the system. E.g. part detail.Data Store: is a data structure for collecting data input or data output. E.g. Part registerData Flow: is a unit of data that is in motion
30 Importance of DD It is a valuable reference for designing the system. It is used to design and writing code during the next phases.It helps the analyst to record the details of each element or structureIt assists in communicating meanings of different terms used
31 Level 1 DFD for payroll system Weekly time sheet
32 Data DictionaryWeekly_timesheet=Employee_name + Employee_Id + [Regular_hours + Overtime_hours]*Pay_rate=[Hourly | daily | weekly] x amountEmployee_name = Last + First + MiddleEmployee_Id = digit + digit + digit + digit[+ sequence or composition| selection* Iteration ]
33 Most DD contains the following information Name: The primary name of the data or control item, the data store, or an external entityAlias: Other names used for the entryWhere used/How used: e.g. Input to the process, output to the process, as a store, or as an external entitySupplementary information: other additional information such as values, restrictions or limitations
34 Object Oriented Modeling In Object oriented Modeling, the system is viewed as a set of objects.The objects interacts with each other through the services they provide.
35 Goals of modelingIdentify the object that exists in the problem domainDefine the classes by encapsulating it states and by its servicesIdentify the relationship that exists between objects of different classesOver all model supports the desired user services.
36 Basic concepts and notations Objects: The system is viewed as consisting of objects. The objects has attributes and provides services.Attributes : add details about an object. It is a pure data value (like integer , string etc). It holds the state of an object.Services: An object provides services or operations. These services are the only means by which the state of the object can be modified or viewed from outside.Class: it is a type definition. Similar objects are grouped together to form a class.
37 Class DiagramsA class is represented as a rectangle divided into 3 parts 1 Top part : contains name of the class 2 Middle part : lists the attributes of objects of that class 3 Third part : lists the services provided by objects of the class
38 To show the relationship between the classes few structures are used. - Generalization-specialization structure : is used by a class to inherit all or some attributes and services of a general class and add more attributes and services to create a class that is a specialized version of the general class.
39 290Figure 8.2 Supertype and Subtype Relationships Between Object ClassesThe figure above illustrates how to depict the supertype, subtype relationship between the PERSON, STUDENT, and TEACHER object classes. All the attributes and behaviors of the PERSON object are inherited by the STUDENT and TEACHER objects. Those attributes and behaviors that are uniquely apply to a STUDENT or TEACHER are recorded directly in the subtype class symbol.
40 -Aggregation structure : models the whole – part relationship -Aggregation structure : models the whole – part relationship. An object may be composed of many objects.
41 Associations structure : helps to know the relations between the instances of a class with the instances of the other class.An association between two classes may beOne-to-one : one instances of one class is related to exactly one instances of other classOne-to-many : one instances of one class is related to many instances of other classMany-to-many : many instances of one class is related to many instances of other class
42 How to obtain the OO model for the system Identifying data objects :Make a brief summary of the problem.Consider nouns, structures, devices, roles played, locations,organizational units etcTo be considered as an object, the system need to be remembered something about the object
43 Identifying structures: Structures represents the hierarchies that exist between the object classes. hierarchies are defined by the concept of generalization-specialization, whole-part relationships between the objects.
44 Identifying attributes : Attributes add details about an object and store data for the object. The attributes to be considered depends on the problem.E.g. while modeling a hospital system,for the class ‘Person’ the attributes are name, height, weight, date_of_birth may be needed, these may not be needed for database for a country that keeps track of populations.So only the attributes that are relevant and required by the problem domain should be considered.
45 Identifying Associations : Associations describe the relationship between the instances of several classes. The association can be 1:1,1:M,and M:MIdentifying services: An object performs a set of predefined services. To identify the services, identify the occur services, which are needed to create, destroy, and maintain the instances of the class. other services depend on the type of services the system is providing.
46 Entity Relationship modeling IEEE defines ER diagram as‘ a diagram that depicts a set of real-world entities and the logical relationships among them’It contains:Data Objects (Entities)AttributesRelationships
47 Data ObjectsA data object is a representation of composite information. (Composite information refers to different features or attributes of a data object.)Has a set of attributes to describe itDrawn as a labeled rectangle in ERDCustomerMember
48 Data Object can beExternal entity – (anything that produces or consumes information)Thing (e.g. report or display)Role (e.g. salesperson)Organizational unit (e.g. accounting department)Place (e.g. warehouse)Structure (e.g. File)
49 AttributesData Attributes describe the properties of a data object. Attributes that identify entities are known as key attributes, that describes an entity are known as non-key attributes.Data attributes are used to perform the following functionNaming the instance of the data objectDescription of instance
50 ATTRIBUTE an entity has a set of attributes attribute defines property of an entityit is given a nameattribute has value for each entityvalue may change over time
51 ATTRIBUTE…. Example : Data object BOOK has the following attributes TITLE AUTHOR PRICEOperating System Galvin Rs 500Software Engg Pressman Rs 800
52 RelationshipsThe connection of data objects or entities with each other is known as relationship.carpersonBasic connection between data objectspersoncarownsRelationship between data objects
53 CardinalityCardinality is the specification of the number of occurrences (instances) of one object that relates to the number of instances of another object.One-to one relationshipOne-to many relationshipMany-to-many relationship
54 ModalityModality describes the possibility that whether a relationship between the entities is required or not.The modality of a relationship is 0 if the relationship is optional, and the modality is 1 if an occurrence of the relationship is essential.
57 customer order Modality: the customer is required to have an order Modality: the customer canarrive without any orderModality: the customer isrequired to have an ordercustomerorderCardinality: single customerPlaced a given orderCardinality: customer hasMany order
58 PDL (Program Design Lang.) PDL , also known as structured English or pseudo code is a language that uses the vocabulary of a natural lang(English) and the overall syntax of a programming lang.The lang is mainly applied during the detailed design phase and is best used to describe alogs and specify interfaces between modules.
59 Benefits of PDLIt enables the progmmer to concentrate on the algo without worrying about all the syntactic details of a particular lang.It is expressed in an easy-to-read format. Thus the design can be converted easily to executable codeReviews become easier since easier to understandIt supports the idea of iterative refinement
60 Examples start Take two numbers Add two numbers and store the result in the variable called sumDivide sum by 2 and store the result in MeanDisplay the resultstop
61 Modeling Logic with Decision Tables A matrix representation of the logic of a decisionSpecifies the possible conditions and the resulting actionsBest used for complicated decision logic
62 3 Parts of a Decision Table Condition stubsLists condition relevant to decisionAction stubsActions that result from a given set of conditionsRulesSpecify which actions are to be followed for a given set of conditionsIndifferent ConditionCondition whose value does not affect which action is taken for two or more rules
63 Procedure for Creating Decision Tables Name the condition and values each condition can assumeName all possible actions that can occurList all rulesDefine the actions for each ruleSimplify the table
64 Decision TableNote: for salaried employees the action stub chosen will always be the same…therefore hours worked is an indifferent condition
65 Reduced Decision Table Because of indifferent condition, the complete decision table can be reduced to one with fewer rules
66 Modeling Logic with Decision Trees A graphical representation of a decision situationDecision situation points are connected together by arcs and terminate in ovalsMain componentsDecision points represented by nodesActions represented by ovalsParticular choices from a decision point represented by arcs
67 Modeling Logic with Decision Trees (cont.) Read from left to rightEach node corresponds to a numbered choice on a legendAll possible actions are listed on the far right
68 Decision tree representation of salary decision
69 Alternative decision tree representation of salary decision