Introduction to ObjectOriented Concept Lecture 1 ObjectOriented Technology
Introduction to Object-Oriented Concept Lecture 1: Object-Oriented Technology and Development
Introduction to Computers In this section we will briefly review the history of computers and the components of a computer and its operating system: A brief History of Computers Types of Computer Inside the computer The Motherboard PC Components CPU Speeds and Memory Size The Operating System Running a Program 2
A Brief History of Computers Early 'Computers' 3000 BC Abacus invented and used for quick, manual addition and subtraction calculations. 1645 A mechanical adding and subtracting machine called the Pascaline (after Blaise Pascal) invented. 1830 Charles Babbage (the Father of Computers) designed first electronic computer called the Difference Machine. It was never built but today's computers are based on it. 1890 Punched Cards invented to tabulate 1890 census. Punched cards used for computer input throughout 1960's. 1939 First vacuum tube calculating machine invented. 3
A Brief History of Computers 'Modern' Computers: 1943 1946 1959 1965 1977 1981 1984 Today First electronic computer built at Bletchley Park for code breaking. First true general purpose, vacuum tube (1 st generation) computer called ENIAC invented. First solid state (2 nd generation) computers using transistors. First integrated circuit (3 rd generation) computers developed by NASA for moon landing programme. First 'home computers' - Altair 8800 - no keyboard or monitor and no software! Came in kit form. Apple II - fully assembled home computer. Introduction of the IBM PC - the forerunner of most of today's PCs. Apple Macintosh - the forerunner of most of the rest. The PC architecture remains the same - just much faster and cheaper. 4
ENIAC (Electronic Numerical Integrator and Computer) 1946 5
Types of Computer Supercomputers Very expensive - so fast they have to be cooled by liquid gases such as Helium. Limited to a few large government and business organisations e. g. for long term weather forecasting. Mainframes Cornerstone of large business, data processing where heavy processing and several thousand users must be handled at once e. g. for bank accounts. Minicomputers A multiuser computer which can handle up to 300 users. In the 1970 s and 1980 s used by medium sized businesses and organisations that could not afford mainframes. Now virtually extinct. Microcomputers The smallest, least expensive and most popular computers - often called desktop computers or personal computers (PCs). Based on Intel (8088, 80286, 80386, 80486, Pentium II and Pentium III) or compatible (AMD Athlon, Duron etc) chips. 6
Objectives • • • Evolution of Software Programming Language Overview of Object Orientation Object Attributes and Operations Difference between an object and a class 3 basic Object-oriented principles (Encapsulation, Inheritance and Polymorphism) © Lethbridge/Laganière 2001 Chapter 1: Software and Software Engineering 7
Generations of Programming Language First Generation Second Generation Third Generation Fourth Generation (4 th GL) © Lethbridge/Laganière 2001 Chapter 1: Software and Software Engineering 8
1. 1 The Nature of Software. . . Software is intangible • Hard to understand development effort Software is easy to reproduce • Cost is in its development —in other engineering products, manufacturing is the costly stage The industry is labor-intensive • Hard to automate © Lethbridge/Laganière 2001 Chapter 1: Software and Software Engineering 9
The Nature of Software. . . Untrained people can hack something together • Quality problems are hard to notice Software is easy to modify • People make changes without fully understanding it Software does not ‘wear out’ • It deteriorates by having its design changed: —erroneously, or —in ways that were not anticipated, thus making it complex © Lethbridge/Laganière 2001 Chapter 1: Software and Software Engineering 10
The Nature of Software Conclusions • Much software has poor design and is getting worse • Demand for software is high and rising • We are in a perpetual ‘software crisis’ • We have to learn to ‘engineer’ software © Lethbridge/Laganière 2001 Chapter 1: Software and Software Engineering 11
Types of Software. . . Custom • For a specific customer Generic • Sold on open market • Often called —COTS (Commercial Off The Shelf) —Shrink-wrapped Embedded • Built into hardware • Hard to change © Lethbridge/Laganière 2001 Chapter 1: Software and Software Engineering 12
Types of Software Differences among custom, generic and embedded software © Lethbridge/Laganière 2001 Chapter 1: Software and Software Engineering 13
Types of Software Real time software • E. g. control and monitoring systems • Must react immediately • Safety often a concern Data processing software • Used to run businesses • Accuracy and security of data are key Some software has both aspects © Lethbridge/Laganière 2001 Chapter 1: Software and Software Engineering 14
1. 2 What is Software Engineering? . . . The process of solving customers’ problems by the systematic development and evolution of large, highquality software systems within cost, time and other constraints Solving customers’ problems • This is the goal of software engineering • Sometimes the solution is to buy, not build • Adding unnecessary features does not help solve the problem • Software engineers must communicate effectively to identify and understand the problem © Lethbridge/Laganière 2001 Chapter 1: Software and Software Engineering 15
What is Software Engineering? … Systematic development and evolution • An engineering process involves applying well understood techniques in a organized and disciplined way • Many well-accepted practices have been formally standardized —e. g. by the IEEE or ISO • Most development work is evolution Large, high quality software systems • Software engineering techniques are needed because large systems cannot be completely understood by one person • Teamwork and co-ordination are required • Key challenge: Dividing up the work and ensuring that the parts of the system work properly together • The end-product that is produced must be of sufficient quality © Lethbridge/Laganière 2001 Chapter 1: Software and Software Engineering 16
What is Software Engineering? Cost, time and other constraints • Finite resources • The benefit must outweigh the cost • Others are competing to do the job cheaper and faster • Inaccurate estimates of cost and time have caused many project failures © Lethbridge/Laganière 2001 Chapter 1: Software and Software Engineering 17
1. 3 Software Engineering and the Engineering Profession The term Software Engineering was coined in 1968 • People began to realize that the principles of engineering should be applied to software development Engineering is a licensed profession • In order to protect the public • Engineers design artifacts following well accepted practices which involve the application of science, mathematics and economics • Ethical practice is also a key tenet of the profession © Lethbridge/Laganière 2001 Chapter 1: Software and Software Engineering 18
1. 4 Stakeholders in Software Engineering 1. Users • Those who use the software 2. Customers • Those who pay for the software 3. Software developers 4. Development Managers All four roles can be fulfilled by the same person © Lethbridge/Laganière 2001 Chapter 1: Software and Software Engineering 19
1. 5 Software Quality. . . Usability • Users can learn it and fast and get their job done easily Efficiency • It doesn’t waste resources such as CPU time and memory Reliability • It does what it is required to do without failing Maintainability • It can be easily changed Reusability • Its parts can be used in other projects, so reprogramming is not needed © Lethbridge/Laganière 2001 Chapter 1: Software and Software Engineering 20
Software Quality. . . Customer: solves problems at an acceptable cost in terms of money paid and resources used User: easy to learn; efficient to use; helps get work done QUALITY SOFTWARE Developer: easy to design; easy to maintain; easy to reuse its parts © Lethbridge/Laganière 2001 Development manager: sells more and pleases customers while costing less to develop and maintain Chapter 1: Software and Software Engineering 21
Software Quality The different qualities can conflict • Increasing efficiency can reduce maintainability or reusability • Increasing usability can reduce efficiency Setting objectives for quality is a key engineering activity • You then design to meet the objectives • Avoids ‘over-engineering’ which wastes money Optimizing is also sometimes necessary • E. g. obtain the highest possible reliability using a fixed budget © Lethbridge/Laganière 2001 Chapter 1: Software and Software Engineering 22
Internal Quality Criteria These: • Characterize aspects of the design of the software • Have an effect on the external quality attributes • E. g. —The amount of commenting of the code —The complexity of the code © Lethbridge/Laganière 2001 Chapter 1: Software and Software Engineering 23
1. 6 Software Engineering Projects Most projects are evolutionary or maintenance projects, involving work on legacy systems • Corrective projects: fixing defects • Adaptive projects: changing the system in response to changes in —Operating system —Database —Rules and regulations • Enhancement projects: adding new features for users • Reengineering or perfective projects: changing the system internally so it is more maintainable © Lethbridge/Laganière 2001 Chapter 1: Software and Software Engineering 24
Software Engineering Projects that involve building on a framework or a set of existing components. • The framework is an application that is missing some important details. —E. g. Specific rules of this organization. • Such projects: —Involve plugging together components that are: - Already developed. - Provide significant functionality. —Benefit from reusing reliable software. —Provide much of the same freedom to innovate found in green field development. © Lethbridge/Laganière 2001 Chapter 1: Software and Software Engineering 25
1. 7 Activities Common to Software Projects. . . Requirements and specification • Includes —Domain analysis —Defining the problem —Requirements gathering - Obtaining input from as many sources as possible —Requirements analysis - Organizing the information —Requirements specification - Writing detailed instructions about how the software should behave © Lethbridge/Laganière 2001 Chapter 1: Software and Software Engineering 26
Activities Common to Software Projects. . . Design • Deciding how the requirements should be implemented, using the available technology • Includes: —Systems engineering: Deciding what should be in hardware and what in software —Software architecture: Dividing the system into subsystems and deciding how the subsystems will interact —Detailed design of the internals of a subsystem —User interface design —Design of databases © Lethbridge/Laganière 2001 Chapter 1: Software and Software Engineering 27
Activities Common to Software Projects Modeling • Creating representations of the domain or the software —Use case modeling —Structural modeling —Dynamic and behavioural modeling Programming Quality assurance • Reviews and inspections • Testing Deployment Managing the process © Lethbridge/Laganière 2001 Chapter 1: Software and Software Engineering 28
1. 8 The Eight Themes of the Book 1. Understanding the customer and the user 2. Basing development on solid principles and reusable technology 3. Object orientation 4. Visual modeling using UML 5. Evaluation of alternatives 6. Iterative development 7. Communicating effectively using documentation 8. Risk management in all SE activities © Lethbridge/Laganière 2001 Chapter 1: Software and Software Engineering 29
1. 9 Difficulties and Risks in Software Engineering • Complexity and large numbers of details • Uncertainty about technology • Uncertainty about requirements • Uncertainty about software engineering skills • Constant change • Deterioration of software design • Political risks © Lethbridge/Laganière 2001 Chapter 1: Software and Software Engineering 30
Florida Community College at Jacksonville Overview of Object Orientation COP 2551 Object-Oriented Programming OO Concepts Overview 31 of 10 slides
Florida Community College at Jacksonville Examples of Objects Use an online store (such as amazon. com) as an example, the following things may consider as Objects: • Book • Customer • Order COP 2551 Object-Oriented Programming OO Concepts Overview 32 of 10 slides
Florida Community College at Jacksonville Object Attributes and Operations • • Attributes know something (Attributes are often data, like order ID and customer ID for an Order object. Attributes can also be another object, such as the entire Customer object rather than just the customer ID. Operations do something with what the attributes know, (Operations can be actions that the object does, often affecting its attributes. ) COP 2551 Object-Oriented Programming OO Concepts Overview 33 of 10 slides
Florida Community College at Jacksonville Difference Between Object And Class • • A class is how you define an object. Classes are descriptive categories or templates. Book could be a class. Objects are unique instances of classes. This Java Certification book that costs $59. 99 with item ID 62467 -B is an object of the Book class. COP 2551 Object-Oriented Programming OO Concepts Overview 34 of 10 slides
Florida Community College at Jacksonville Difference Between Object And Class (continue) • • The attributes and operations defined by a class are for its objects, not for itself. There is no concrete realization of the class Book, but there are Book objects, i. e. a class is a logical construct, an object has physical reality. A class can be compared to a blueprint. Imagine you are in charge of building a housing development, with one housing blueprint. Each house in a development is shaped the same way, but some have brick or aluminum siding, some have custom paint colors inside and some are just white, and so on. COP 2551 Object-Oriented Programming OO Concepts Overview 35 of 10 slides
Florida Community College at Jacksonville Object-oriented Principle – Encapsulation • Encapsulation is the mechanism that binds together the code and the data it manipulates, and keeps both safe from outside interference and misuse. Public variables and methods A Class Private variables and methods Public variables is not recommended COP 2551 Object-Oriented Programming OO Concepts Overview 36 of 10 slides
Florida Community College at Jacksonville Object-oriented Principle Inheritance • Inheritance is the process by which one object acquires the properties of another object. By use of inheritance, an object need only define all of its characteristics that make it unique within its class, it can inherit its general attributes from its parent. Account Checking COP 2551 Object-Oriented Programming Mortgage Loan OO Concepts Overview 37 of 10 slides
Florida Community College at Jacksonville Object-oriented Principle – Polymorphism • • Polymorphism(from Greek, meaning“many forms”) is a feature that allows one interface to be used for a general class of actions, i. e. one interface, multiple methods. Example: Account. calculate. Interest() COP 2551 Object-Oriented Programming OO Concepts Overview 38 of 10 slides
- Slides: 38