oose chapter one

Upload: sirhaleke-gelma-godana

Post on 04-Mar-2016

20 views

Category:

Documents


0 download

DESCRIPTION

doc

TRANSCRIPT

  • Object Oriented Software Engineering (SE 3081 )

  • CHAPTER ONEIntroduction

  • 1.1 IntroductionSoftware engineeringThe economies of ALL developed nations are dependent on software.More and more systems are software controlledSoftware engineering is concerned with theories, methods and tools for professional software development.Expenditure on software represents a significant fraction of GNP in all developed countries.

  • Why Software Engineering ?1950s and 1960s, Systems Development was unstructured & unorganizedInterface misuseOn April 10, 1990, in London, an underground train left the station without its driver.Leap-year bugA supermarket was fined $1000 for having meat around 1 day too long, on February 29, 1988.Unnecessary complexityThe C-17 cargo plane by McDonnell Douglas ran $500 million over budget because of problems with its avionics software. The C-17 included 19 onboard computers, 80 microprocessors, and 6 different programming languages.

  • Late and over budgetIn 1995, bugs in the automated luggage system of the new Denver International Airport caused suitcases to be chewed up. The airport opened 16 months late, $3.2 billion over-budget, with a mostly manual luggage system.On-time deliveryAfter 18 months of development, a $200 million system was delivered to a health insurance company in Wisconsin in 1984. However, the system did not work correctly: $60 million in overpayments were issued. The system took 3 years to fix.

  • Software costsSoftware costs often dominate computer system costs. The costs of software on a PC are often greater than the hardware cost.Software costs more to maintain than it does to develop. For systems with a long life, maintenance costs may be several times development costs.Software engineering is concerned with cost-effective quality software development.

  • FAQsWhat is software?What is software engineering?What is the difference between software engineering and computer science?What is the difference between software engineering and system engineering?What is a software process?What is a software process model?What are the costs of software engineering?What are software engineering methods?What is CASE (Computer-Aided Software Engineering)What are the attributes of good software?What are the key challenges facing software engineering?

  • What is Software?Computer programs and associated documentation such as requirements, design models and user manuals.Software products may be developed for a particular customer or may be developed for a general market.Software products may beGeneric - developed to be sold to a range of different customers e.g. PC software such as Excel or Word, AUTOCAD, .Bespoke (custom) - developed for a single customer according to their specification such as control system for electronic devices, Human resource management system, Registrar System New software can be created by developing new programs, configuring generic software systems or reusing existing software.

  • An important difference between these types of software is that, in generic products, the organization that develops the software controls the software specification.For custom products, the specification is usually developed and controlled by the organization that is buying the software. The software developers must work to that specification.However, the line between these types of products is becoming increasingly blurred. More and more software companies are starting with a generic system and customizing it to the needs of a particular customer. Enterprise Resource Planning (ERP) systems, such as the SAP system, are the best examples of this approach. Here, a large and complex system is adapted for a company by incorporating information about business rules and processes, reports required, and so on

  • Group Assignment oneRead About Enterprise Resource Planning (ERP) and Write a short description about ERP, its components and so on. Choose one component and try to modify some of its functionality. Due Date 1 week after the assignment has been given

  • What is software engineering?Software engineering is an engineering discipline that is concerned with all aspects of software production from the early stage of system specification to maintaining the system.Software engineers should adopt a systematic and organised approach to their work and use appropriate tools and techniques depending on the problem to be solved, the development constraints and the resources available.

  • What is the difference between software engineering and computer science?Computer science is concerned with theory and fundamentals that underlie computers and software systems; software engineering is concerned with the practicalities of developing and delivering useful software.Some knowledge of computer science is essential for software engineers in the same way that some knowledge of physics is essential for electrical engineers.Computer science theories are still insufficient to act as a complete underpinning for software engineering

  • What is the difference between software engineering and system engineering?System engineering is concerned with all aspects of computer-based systems development including hardware, software and process engineering. Software engineering is part of this process concerned with developing the software infrastructure, control, applications and databases in the system.System engineers are involved in system specification, architectural design, integration and deployment (Consider aircraft and chemical plants).

  • What is Software ProcessA set of activities whose goal is the development or evolution of software.Generic activities in all software processes are:Specification - what the system should do and its development constraintsDevelopment - production of the software systemValidation - checking that the software is what the customer wantsEvolution - changing the software in response to changing demands(needs).

  • What is a software process model?A simplified representation of a software process, presented from a specific perspective.It might include activities that are part of the software process, software products, and the role of people involved in software engineering.Examples of process perspectives areWorkflow perspective - this shows sequence of activities in the process along with their inputs, outputs and dependencies; the activities in this model represent the human actions.Data-flow perspective this represents the process as a set of activities, each of which carries out some data transformation. It shows how the input to process, such as a specification, is transformed to an output, such as a design;Role/action perspective represents the roles of the people involved in the software process and the activities for which they are responsible.Generic process modelsWaterfall;Iterative development;Component-based software engineering.

  • What are the costs of software engineering?Roughly 60% of costs are development costs, 40% are testing costs. For custom software, evolution costs often exceed development costs.Costs vary depending on the type of system being developed and the requirements of system attributes such as performance and system reliability.Distribution of costs depends on the development model that is used.

  • What are software engineering methods?

    It is a structured approaches to software development which include system models, notations, rules, design advice and process guidance for a quality software production in a cost effective mannerModel descriptionsDescriptions of graphical models which should be produced;RulesConstraints applied to system models;RecommendationsAdvice on good design practice;Process guidanceWhat activities to follow.

  • What is CASE (Computer-Aided Software Engineering)?Software systems that are intended to provide automated support for software process activities. CASE systems are often used for method support.Upper-CASETools to support the early process activities of requirements and design;Lower-CASETools to support later activities such as programming, debugging and testing.

  • What are the attributes (non functional requirement) of good software?The software should deliver the required functionality and performance to the user and should be maintainable, dependable and acceptable.MaintainabilitySoftware must evolve to meet changing needs;DependabilitySoftware must be trustworthy; includes reliability, security, and safety;EfficiencySoftware should not make wasteful use of system resources; includes responsiveness, processing time, memory utilization,...Acceptability/UsabilitySoftware must be accepted by the users for which it was designed. This means it must be understandable, usable and compatible with other systems and have proper documentation.

  • What are the key challenges facing software engineering?Heterogeneity, delivery and trust.HeterogeneityDeveloping techniques for building software that can cope with heterogeneous platforms and execution environments (for example a system that runs both on Linux and windows OS);DeliveryDeveloping techniques that lead to faster delivery of software without compromising quality;TrustDeveloping techniques that demonstrate that software can be trusted by its users especially those accessed remotely using web page or web service interface.

  • Professional and ethical responsibilitySoftware engineering involves wider responsibilities than simply the application of technical skills.Software engineers must behave(perform) in an honest and ethically responsible way if they are to be respected as professionals.Ethical behaviour is more than simply upholding the law.

  • Issues of professional responsibilityConfidentiality Engineers should normally respect the confidentiality of their employers or clients irrespective of whether or not a formal confidentiality agreement has been signed.Competence Engineers should not misrepresent their level of competence. They should not knowingly accept work which is beyond their competence.Intellectual property rights Engineers should be aware of local laws governing the use of intellectual property such as patents, copyright, etc. They should be careful to ensure that the intellectual property of employers and clients is protected.Computer misuse Software engineers should not use their technical skills to misuse other peoples computers. Computer misuse ranges from relatively trivial (game playing on an employers machine, say) to extremely serious (dissemination of viruses).

  • 1.2 Two Orthogonal view of software.TraditionalModern(Object oriented)TraditionalViews software as a collection of programs(functions) and isolated dataProgram=algorithm + data structureObject OrientedFocus on object which combines data and functionality

  • 1.3 Object oriented system development methodologyIs a way to develop a software by building self contained modules or objects that can be easily replaced, modified & reusedIn object oriented, software is a collection of discrete objects that encapsulate their data as well as functionalities to model the real world objects.In object oriented system every thing is an object & each object is responsible for itself.

  • ExampleEvery window application needs window object that can open themselves on a screen and either display something or accept input.A window object is responsibility for things like opening, sizing and closing itself. Frequently, when a window display something that something is also an object.

  • 1.4 Why object oriented?Easier to adapt to changing requirements, easier to maintain, more robust and promotes greater design and code use.High level of abstractionTop down: abstraction at function levelOO: abstraction at object level (since objects encapsulate both data(attribute) and function (method).Seamless transition among different phases of software developmentEncourage good programming techniquesChanging one class cannot affect the otherNothing is magicalPromotion of reusability Because objects are directly modeled from real world problem domain each object stands by itself or within a small circle of peers(other objects)Inheritance(only difference and enhancement is needed to be designed and coded)

  • 1.5 Overview of the unified approach.Over the past decade, Grady Booch, James Rumbaugh, and Ivar Jacobson have collaborated to combine the best features of their individual object-oriented analysis and design methods into a unified method. The result, called the Unified Modeling Language (UML), has become widely used throughout the industry.UML is a generic broad language enabling the key aspects(features) of software development to capture on paper.

  • 1.6 An object oriented philosophySoftware development is dynamic and always undergoing major changesToday various number of tools and methodologies are available for software developmentReading assignmentRead about an object oriented philosophy from the book OOSD-Alibahrami: pages- 14 & 15

  • 1.7 Basic concept of object

    Classes are used to distinguish one type of object from anotherIn the context of object oriented systems, a class is a set of objects that share a common structure and a common behaviorA single object is simply an instance of a class The chief role of a class is to define proprieties and procedures(the sate and behavior ) and applicability of its instance

  • Example

  • The instructions responded by each of those instances o employee are managed by the class .The data associated with a particular object is managed by the object itself

  • Attributes object state and properties.

    Properties represent the state of an object

  • Object behavior and methodsWhen we talk about car , we can drive a carWhen we talk about horse, we can ride a horseIn the object model object behavior is described in methods or behaviorsA method implements the behavior of an object

  • Abstraction, Encapsulation, And Information HidingInstead of saying we determined what a class knows and does, we say we "abstracted" the class. Instead of saying we designed how the class will accomplish these things, we say we "encapsulated" them. Instead of saying we designed the class well by restricting access to its attributes, we say we have "hidden" the information.

  • AbstractionThe world is a complicated place. To deal with that complexity we form abstractions of the things in it. For example, consider the abstraction of a person. From the point of view of a university, it needs to know the person's name, address, telephone number, social security number, and educational background. From the point of view of the police, they need to know a person's name, address, phone number, weight, height, hair color, eye color, and so on. It is still the same person, just a different abstraction, depending on the application at hand.

  • Abstraction is an analysis issue that deals with what a class knows or does. Your abstraction should include the responsibilities, the attributes, and the methods of interest to your applicationand ignore the rest. That is why the abstraction of a student would include the person's name and address, but probably not his or her height and weight. OO systems abstract only what they need to solve the problem at hand. People often say abstraction is the act of painting a clear box around something: you are identifying what it does and does not do. Some people will also say that abstraction is the act of defining the interface to something. Either way, you are defining what the class knows and does.

  • EncapsulationAlthough the act of abstraction tells us that we need to store a student's name and address, as well as be able to enroll students in seminars, it does not tell us how we are going to do this. Encapsulation deals with the issue of how you intend to modularize the features of a system. In the object-oriented world, you modularize systems into classes, which, in turn, are modularized into methods and attributes. We say that we encapsulate behavior into a class or we encapsulate functionality into a method.is an Object Oriented Programming concept that binds together the data and functions that manipulate the data, and that keeps both safe from outside interference and misuse.

  • Encapsulation is a design issue that deals with how functionality is compartmentalized within a system. You should not have to know how something is implemented to be able to use it. The implication of encapsulation is that you can build anything anyway you want, and then you can later change the implementation and it will not affect other components within the system (as long as the interface to that component did not change).

  • People often say encapsulation is the act of painting the box black: you are defining how something is going to be done, but you are not telling the rest of the world how you are going to do it. In other words you are hiding the details of the implementation of an item from the users of that item. For example, consider your bank. How does it keep track of your account information, on a mainframe, a mini, or a PC? What database does it use? What operating system? It does not matter, because it has encapsulated the way in which it performs account services. You just walk up to a teller and initiate whatever transactions you want. By hiding the details of the way it has implemented accounts, your bank is free to change that implementation at any time, and it should not affect the way services are provided to you.

  • Information HidingTo make your applications maintainable, you want to restrict access to data attributes and some methods. The basic idea is this: if one class wants information about another class, it should have to ask for it, instead of taking it. When you think about it, this is exactly the way the real world works. If you want to learn somebody's name, what would you do? Would you ask the person for his name, or would you steal his wallet and look at his ID? By restricting access to attributes, you prevent other programmers from writing highly coupled code. When code is highly coupled, a change in one part of the code forces you to make a change in another, and then another, and so on.

  • Example: the driver's interface for a carThe abstraction is how you work with the wheel, pedals, and gearshift to drive a car. Encapsulation allows various carmakers to provide a consistent interface, although each brand of car is built differently. Information hiding is represented by the fact that although the oil is kept at a specific pressure within the engine the driver does not know what the exact pressure is. In other words, information about the oil is hidden from the user.

  • InheritanceInheritance models "is a", "is kind of", and "is like" relationships, enabling you to reuse existing data and code easily.ExampleOnce you have the class Person defined, you then make Student and Professor inherit from it. You would say Person is the superclass of both Student and Professor, and Student and Professor are the subclasses of Person. Everything that a superclass knows or does, the subclass knows or does free without writing extra code. Actually, for this example, you would need to write two lines of code, one saying Student is a subclass of Person, and another saying Professor is a subclass of Person; therefore, it is almost free. Because Person has a name, address, and telephone number, both Student and Professor also have those attributes. Because Person has the ability to drive a vehicle, so do the classes Student and Professor.

  • Inheritance Tips and TechniquesLook for similaritiesLook for existing classesFollow the sentence ruleInherit everything.

  • Abstract and Concrete Classesthe class Vehicle is marked as abstract whereas Airplane and Car are not. We say Vehicle is an abstract class, whereas Airplane and Car are both concrete classes. The main difference between abstract classes and concrete classes is that objects are instantiated (created) from concrete classes, but not from abstract classes. For example, in your problem domain, you have airplanes and cars, but you do not have anything that is just a vehicle (if something is not an airplane or a car, you are not interested in it). This means your software will instantiate airplane and car objects, but will never create vehicle objects. Abstract classes are modeled when you need to create a class that implements common features from two or more classes.

  • THANKS!