1 / 17

Introduction

Object Oriented Programming (OOP). Introduction. Instructor Fasee Ullah Abasyn University, Peshawar. Computers. What is a computer? A computational device Logical decisions billions of times faster than humans Hardware keyboard, screen, disks, memory, CPU Software

Download Presentation

Introduction

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. Object Oriented Programming(OOP) Introduction Instructor Fasee Ullah Abasyn University, Peshawar

  2. Computers • What is a computer? • A computational device • Logical decisions billions of times faster than humans • Hardware • keyboard, screen, disks, memory, CPU • Software • email, word processing, spreadsheets, OS

  3. Computer Organization • Input unit • keyboard, microphone • Output unit • screen, printer • Memory unit • Random Access Memory (RAM) • short-term, rapid access, • Arithmetic and logic unit • calculations, comparisons • Central Processing Unit (CPU) • coordinator, administrator • Secondary storage unit • disks, tapes • high capacity warehouse

  4. A Hierarchy of Languages

  5. Programming Languages • Machine language • Native to a processor: executed directly by hardware • Instructions consist of binary code: 1s and 0s • Assembly language • Slightly higher-level language • Readability of instructions is better than machine language • One-to-one correspondence with machine language instructions • Assemblers translate assembly to machine code • Compilers translate high-level programs to machine code • Either directly, or • Indirectly via an assembler

  6. Compiler and Assembler

  7. Preprocessor program processes the code. Compiler creates object code and storesit on disk. Compiler Linker links the object code with the libraries Primary Memory Loader Loader puts program in memory. Primary Memory CPUtakes each instruction and executes it, possibly storing new data values as the program executes. CPU Preprocessor Linker Editor Disk Disk Disk Disk Disk . . . . . . . . . . . . Program Development Environment Program is created in the editor and stored on disk. • Phases of C/C++ Programs: • Edit • Preprocess • Compile • Link • Load • Execute

  8. Weakness of C language • ‘C’ is not strong typed language e.g int a; a=“Pak” • C program is scattered which may look confusing • C program is not self-explanatory like other languages such as BASIC, Pascal etc • C program is more understandable to the author and for no one else

  9. Weakness of C language • Any legal program of C also legal in C++ while reverse not possible

  10. Structured Programming Structure Chart

  11. Cornerstones of OOP & OOSE • OOP provides • Extensibility • Software Reusability • Encapsulation

  12. Extensibility of OOP • Program creates own data type • class rectangle{ • class ball{ • class point {

  13. Software Reusability • In this phase using inheritance • For example class Person { • Can inherit various information for inherited classes • eg class employee{, • class visitor{

  14. Encapsulation • To keep data hide • Attributes of encapsulation • Private • Public • protected

  15. OOSE Background • Originated in Sweden • Object Oriented Software Engineering a use case driven approach • Pragmatic method based on experience • Popular and successful • Complete method

  16. What comprises a method? • It includes • Syntax (how it looks) • Semantic (what it means) • Pragmatic (heuristics, rule of thumbs etc)

  17. 3 Stages, 5 Models • Stages are • Analysis • Construction • Testing • Model are • Requirements model • Analysis model • Design model • Implementation model • Testing Model

More Related