Chapter 31 An Overview of Software Development Defining




























- Slides: 28
Chapter 31 An Overview of Software Development • Defining the problem – requirements analysis • Analyzing the requirements – constructing an initial structural model • Analyzing the behavior – constructing dynamic models • Identifying use cases • Communication with the user interface • Walk-troughs and navigation of associations • Sequence diagrams • Communicating with the user • Detailed design and implementation • Summary Prepared by: Miss Samar Ali Shilbayeh
New concepts • In this chapter a simple example is used to • illustrate the main activities involved in an object -oriented approach to software development and as a result many new concepts are mentioned. . The purpose of this chapter is for you to get some insight into how the various concepts and activities contribute to the whole process of moving from a problem statement to a working software system. Prepared by: Miss Samar Ali Shilbayeh
Do This in pairs now • Software development is a process which, starting from an initial description by the • client or user of what is required, produces and delivers a final, tested software system that satisfies these requirements. What do you think the order of the following activities in order to reach your final system • Analysis – analyzing the specification of requirements to develop a detailed • • • understanding in computing terms of what the system has to do Requirements analysis – the process of producing a detailed and complete specification of the requirements of the system. Implementation – translating the completed design into program code in some suitable programming language. Design – deciding how the system will meet the specified requirements. • Testing – not just testing the final product but testing at each stage to ensure that what is produced relates correctly to the previous stage and to the user requirements Prepared by: Miss Samar Ali Shilbayeh
Introduction • Traditionally, software development has been divided into the • • • following activities. Requirements analysis – the process of producing a detailed and complete specification of the requirements of the system. Analysis – analyzing the specification of requirements to develop a detailed understanding in computing terms of what the system has to do. Design – deciding how the system will meet the specified requirements. Implementation – translating the completed design into program code in some suitable programming language. Testing – not just testing the final product but testing at each stage to ensure that what is produced relates correctly to the previous stage and to the user requirements. Prepared by: Miss Samar Ali Shilbayeh
• in this chapter, which attempts to give an overview of the whole development process, we have sections looking at the following activities. • Requirements analysis – producing a negotiated statement of requirements. (Requirements analysis) • Developing a structural model – determining the classes and connections between them that define an appropriate structure within which the behaviour required of the system can take place. (Analysis) • Developing dynamic models – determining what interactions among objects are needed to achieve the behavior required of the system. (Analysis and Design) • Communicating with the user – designing and developing a suitable user interface and its communication with the domain model. (Analysis and Design) • Detailed design and implementation – deciding what preexisting classes can be reused and what programming constructs are appropriate as well as writing the actual code. (Design and Implementation) Prepared by: Miss Samar Ali Shilbayeh
In the software development process follow up the following process Requirements analysis Developing a structural model Developing dynamic models Communicating with the user Prepared by: Miss Samar Ali Shilbayeh Detailed design and implementation
• Discuss with your partner the main different between the following term: • domain model, structural model and dynamic model Prepared by: Miss Samar Ali Shilbayeh
• The domain model, is that part of the software system that is independent of the user interface; it models the real-world objects whose behavior the system represents. • Structural models and dynamic models, on the other hand, provide representations, in varying degrees of completeness, of different aspects of the domain model. Prepared by: Miss Samar Ali Shilbayeh
Defining the problem – requirements analysis • Here is a short description of the problem that we shall • • • be using to illustrate the software development process. A computer system is required for a small video lending library. At any time the system should be able to list what videos any member currently has on loan and be able to indicate how many copies of any film are not on loan. The process of analyzing the initial statement of requirements in consultation with the client and the potential users of the system is known as requirements analysis. The aim of requirements analysis is to reach an agreed and unambiguous specification called the negotiated statement of requirements. Prepared by: Miss Samar Ali Shilbayeh
Some questions could be came over: • Can anyone borrow videos? • What information about members does the • • system need? Can a member borrow any number of videos? Does the library have only one copy of each video? How are different copies of a film distinguished? What precisely is meant by ‘film’, ‘video’ and ‘copy’? Prepared by: Miss Samar Ali Shilbayeh
The negotiated statement of requirements for the Video Library system • The library holds video copies of a number of films. It may have one • • or more copies of each film. The system should, for each film, hold the film’s title; no two films have the same title. A library member can borrow any video copy of a film that is not currently on loan. However, no member can have more than two copies on loan at a time. When a library member returns a copy it immediately becomes available for loan. Each copy has a unique identifying number Each member of the library has a unique membership number; the system also holds each member’s name. Prepared by: Miss Samar Ali Shilbayeh
Analyzing the requirements – constructing an initial structural model • There are three distinct types of ‘knowledge’ involved here. These are knowledge of: • (a) films, copies, members; • (b) film titles, copy numbers, member names, member numbers; • (c) which members have which copies on loan, which film a copy is a copy of Prepared by: Miss Samar Ali Shilbayeh
Classes and association • What is the following diagram indicates ? Member has. On. Loan Copy is. Copy. Of Film • The rectangles represent classes. • The lines joining the classes represent what are called associations. In • • just the same way as objects are instances of classes, so the links between objects are instances of associations. Thus the association has. On. Loan represents the fact that an instance of the class Copy may be linked to an instance of the class Member by virtue of the fact that the library member has currently got that copy on loan. such as Figure are known as class diagrams. Prepared by: Miss Samar Ali Shilbayeh
• If you examine the requirements you will see that no • member can have more than two copies on loan at a time. Thus each instance of Member will be linked at any one time to 0, 1 or 2 instances of Copy by the has. On. Loan association; we say that the multiplicity of has. On. Loan at the Copy end is 0. . 2. In the same way, each instance of Copy is linked at a given time to at most one instance of Member ; so the multiplicity of has. On. Loan at the Member end is 0. . 1. These multiplicities can be shown on the class diagram as in Figure 0. . 2 is pronounced ‘zero to two. ’ Member has. On. Loan Copy 0… 1 Multiplicities 0… 2 Prepared by: Miss Samar Ali Shilbayeh
Class Description • • • Class: Member Attributes: name "The name of the member" member. No "The unique membership number of the member" Class: Copy Attributes: copy. No "The unique identifying number of the copy" Class: Film Attributes: title "The unique title of the film" Prepared by: Miss Samar Ali Shilbayeh
Member 0… 1 • • • has. On. Loan 0… 2 Film Copy 1…* Film 1 Class: Member Attributes: name "The name of the member" member. No "The unique membership number of the member" Class: Copy Attributes: copy. No "The unique identifying number of the copy" Class: Film Attributes: title "The unique title of the film" Prepared by: Miss Samar Ali Shilbayeh
Analyzing the behavior – constructing dynamic models • Identifying use cases: • Below, we present the part of the negotiated statement of requirements for the Video Library system that describes the required behaviour. • The system that has to be designed must be able to do the following: • for any film, give the number of copies of that film that are currently available for loan; • for any member, list all the films that the member currently has copies of on loan; • update the system whenever a copy is borrowed or returned. • From the above fragment of the NSR we can identify four distinct behaviors These are as follows. • Give the number of available copies of a film. • Give a list of the films that a member has copies of on loan. • Record that a member borrows a copy. • Record that a copy is returned. Prepared by: Miss Samar Ali Shilbayeh
• What do you think the main use cases that we are concern about in developing our system? ? • Get Number Available • List Film • For each use case and according to the initial negotiated statement work with your partner to find out your use case as given and result Prepared by: Miss Samar Ali Shilbayeh
Get Number Available • This use case requires that, for any film, the system be able to give the number of copies of that film that are currently available for loan. • Given: a film title, a. Title • Locate the instance, a. Film, of Film with title a. Title. • In order to do this the orchestrating instance, admin, needs to keep a record of all the Film instances (using the title as a key to find a particular Film instance). • This means there is an association between the classes Lib. Admin and Film. We will call this association film. • We say that admin ‘keeps track of’ the Film instances, meaning that admin keeps a record of Film instances. When an object in a class uses a link of an association to locate an object in another class, we say the association is navigate from the first class to the second. • This is shown in the Figure , in which the arrow on the association line indicates the direction of navigation. films Lib. Admin 1 0…* Film Prepared by: Miss Samar Ali Shilbayeh
In The Diagram notice the following: films Lib. Admin Film 1 0…* • The direction of the arrow indicates the direction of the navigation • • • we say that films is navigated from Lib. Admin class to Film class We need to note that admi has to be able to identify the relevant instance of Film, from its title, via the association film. We add this responsibility in the class description for the class Lib. Admin under the heading Associations: Class: Lib. Admin Attribute : None Association : Use titles to keep track of instances of Film linked via films. Prepared by: Miss Samar Ali Shilbayeh
• Try to do the same for the second use case list. Films Prepared by: Miss Samar Ali Shilbayeh
List Films • What is needed here is, for any member, to give a list of the films that the member has copies of on loan. • To identify the instance of Member , the user interface can use the unique membership number. • This will require admin to keep track of Membe instances using their membership numbers, and so there must be an association (we will call it members) between Lib. Admin and Member members 0…* Lib. Admin 1 Prepared by: Miss Samar Ali Shilbayeh
From The previous Diagram: • Given: a membership number, a. Member. No • Locate the instance, a. Member , of Member with • • • membership number a. Member. No linked to admi via members. Accordingly the class Lib. Admin has the following ‘association’ responsibility. Use membership numbers to keep track of instances of Member linked via members. Result: the relevant film titles. Prepared by: Miss Samar Ali Shilbayeh
Walk-troughs and navigation of associations: • To analyze a use case we break down its requirements • • • into simpler steps, a process we began in the previous section. These steps constitute what is called a walk-through of the use case. For Get Number Available we can proceed as follows. Given: a film title, a. Title Locate the instance, a. Film, of Film with title a. Title, linked to admin via film Get a. Numbe , the number of available copies of a. Film. Result: a. Number. Prepared by: Miss Samar Ali Shilbayeh
1 Lib. Admin memebers 0…* Member films 0…* is. Acopy. Of has. On. Loan 0… 1 1 Copy 0… 2 Film 1…* 1 Prepared by: Miss Samar Ali Shilbayeh
Sequence diagrams • A sequence diagram is a dynamic model of part of the system. • We repeat the walk-through for Get Number Available here for • • • reference. Given: a film title, a. Title 1 Locate the instance, a. Film, of Film with title a. Title, linked to admin via films. 2 Get a. Number , the number of available copies of a. Film. Result: a. Number. A sequence diagram for this walk-through is given in the figure admin a. Film number. Available(a. Title) 2 1 get. Number. Available Prepared a. Numberby: Miss Samar Ali Shilbayeh
• For the List Films use case we have the following walk • • through and sequence Given: a membership number, a. Member. No 1 Locate the instance, a. Member , of Member with membership number a. Member. No linked to admin via members. 2 Locate all the instances of Copy that are linked to a. Member via has. On. Loan. For each such instance, a. Copy , of Copy 3 locate the instance of Film linked to a. Copy via is. Copy. Of 4 Form a collection, films , of all the instances of Film located in 3. 5 Retrieve the titles of the instances of Film in films. Result: the relevant film titles. Prepared by: Miss Samar Ali Shilbayeh
• Sequence Diagram for List. Film admin a. Member a. Copy list. Film(a. Member. No) 1 get. Film 2 films 5 *get. Film a. Film 3 4 *get. Title a. Title Prepared by: Miss Samar Ali Shilbayeh a. Film