1 / 27

Refining the Structure of the Requirements Model

Refining the Structure of the Requirements Model. Aim: To create the conditions for software re-use. Bennett, McRobb and Farmer ch 8. Mechanisms for Software Reuse. 1. Abstraction mechanisms: generalisation, composition, encapsulation/information hiding

hugh
Download Presentation

Refining the Structure of the Requirements Model

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Refining the Structure of the Requirements Model Aim: To create the conditions for software re-use. Bennett, McRobb and Farmer ch 8

  2. Mechanisms for Software Reuse 1. Abstraction mechanisms: generalisation, composition, encapsulation/information hiding 2. Specification of Reusable software components 3. Application of Analysis Patterns

  3. Approaches to Re-Use • Import existing components or structures from beyond the project boundaries (e.g. re-use of platform-specific components e.g. .Net). • Reuse components of current project- identify existing or design with re-use in mind. • Design new components for use within other projects.

  4. Why Re-Use? • No need to reinvent the wheel • Enforces standardisation which can make subsequent change easier

  5. How to re-use 1. The starting point for reuse opportunities is within requirements analysis. Refinement is done through : (i) abstracting common elements i.e. identifying where you can use generalisation/inheritance) and (ii) the encapsulation of composite structures and components.

  6. Abstraction mechanisms in OO 1. Generalisation/ Inheritance 2. Encapsulation 3. Composition

  7. 1. Inheritance/generalisation • identifying those aspects of a design that are relevant to more than one situation and redesigning your classes to put the common aspects in a parent class and the specific aspects in a child class. • Abstract classes are parent classes which have no members in themselves but specify common aspects of a number of (concrete) child classes which can be reused easily. • ISA –IS A KIND OF is the key relationship here.

  8. Example- Agate (ch 8)

  9. Example: Sligo Motorhomes

  10. 2. Encapsulation • design software that can be used as a black box component. • To use it you only need to know how the interface works – not the implementation. • This means that you can have different implementations for the same interface, which could be useful, for example in porting an application to different platforms. • The focus is on the external behaviour, but ignoring the detail of how that behaviour is produced.

  11. Example : C# libraries • We don’t know the implementation of window, textbox .. or any of the other hundreds of classes in WPF, Windows forms etc. BUT • We know their interface so we can use them

  12. 3. Composition • involves encapsulating a group of classes that have the capacity to be a re-usable subassembly. • The relationship here is ISA Part Of. • Composition – is made up of ... A car has an engine • Aggregation- can have 0 or more – sand grains on the beach

  13. Example • A newspaper advert can be composed of copy(text), graphics and a photograph. 1..* 1..* 0..* 1..* 1..* 0..*

  14. Packages and Dependencies • The aim here is to ensure the system remains robust in the face of changing requirements. • Organise classes into packages in such a way that change is localised. • Show dependencies between these packages e.g. if a class in one package uses or is related to an object in another package this must be shown in the package diagram.

  15. Divide your classes into packages

  16. Example Agate (p246) • Packages mark out related but distinct application areas: advert preparation, staff management, campaign management. staff management User Interface Control campaign management advert preparation

  17. Components • Relatively complex structures developed separately to be plugged together. • Meet a clear-cut but general need. • Have more than 1 simple well-defined external interfaces.

  18. UML Support for Modelling Components • Component A has a provided interface which offers services to components that know how to request those services. • Component B has a required interface which requests services from a provided interface on another component. (basically it will send a message using a defined operation and parameters frpm some provided interface).

  19. Ball and socket diagram. Component A Component B

  20. In UML, a component diagram provides a physical view of the system. Its purpose is to show the dependencies that the software has on the other software components (e.g., software libraries) in the system. • The diagram can be shown at a very high level, with just the large-grain components, or it can be shown at the component package level i.e. class container levels such as .NET's namespaces (e.g., System.Web.UI).

  21. Component-Based Development • The classes that comprise an individual component need to be identified, modelled, specified designed and coded. • Components must be designed to a common standard e.g. • A component’s behaviour is described by its specification. • A specification can have many implementations e.g. to work on many platforms.

  22. Example: Airline Booking System • In airline systems there is often a mix of systems, including older systems and other different systems trying to do the same things. • Systems need to be designed to enable the upgrading of older systems with minimum fuss and to enable the use of different types of booking process. • A Bookings component provides an interface called makebooking which is available to any system who knows how to use it i.e. knows the services provided and their protocols or signatures

  23. Service Oriented Architecture • Designed to enable larger grained components to be integrated together • Needs clear interface design • E.g. Web services use

  24. makebooking From Bennett Mc Robb and Farmer p250 <<component>> Payments <<component>> Bookings takepayment <<component>> Customers managecustomers allocateseats allocateseats <<component>> Check-in <<component>> FlightManagement

  25. Software Development Patterns • A pattern is a template of an example worth copying. • Analysis patterns provide a structure of classes and associations that occur again and again. Each pattern can be used to communicate a general understanding about how to model a particular set of requirements.

  26. Example 1 0..* Bennett, Mc Robb and Farmer p254

  27. Software components can reduce the effort in coding and implementation. • Analysis components and patterns can reduce the time taken to develop and test a design and also act as a store of knowledge that embodies best practice. They can also reduce the time taken to develop a deep understanding of the system.

More Related