Lecture 2 of Computer Science II

Slides:



Advertisements
Similar presentations
PROGRAMMING LANGUAGE (JAVA) UNIT 42 BY ROBERT BUTTERFIELD TELEPHONE Data Structures and Algorithms.
Advertisements

Data Structures.
Programming Paradigms and languages
Department of Computer Engineering Faculty of Engineering, Prince of Songkla University 1 5 – Abstract Data Types.
COMPSCI 105 S Principles of Computer Science 12 Abstract Data Type.
Chapter 1 Object Oriented Programming. OOP revolves around the concept of an objects. Objects are crated using the class definition. Programming techniques.
Software Engineering and Design Principles Chapter 1.
Algorithms and Problem Solving-1 Algorithms and Problem Solving.
© 2006 Pearson Addison-Wesley. All rights reserved4-1 Chapter 4 Data Abstraction: The Walls.
Basic Definitions Data Structures: Data Structures: A data structure is a systematic way of organizing and accessing data. Or, It’s the logical relationship.
© 2006 Pearson Addison-Wesley. All rights reserved4-1 Chapter 4 Data Abstraction: The Walls.
Data Structures Using C++1 Chapter 1 Software Engineering Principles and C++ Classes.
1 ES 314 Advanced Programming Lec 2 Sept 3 Goals: Complete the discussion of problem Review of C++ Object-oriented design Arrays and pointers.
© 2006 Pearson Addison-Wesley. All rights reserved2-1 Chapter 2 Principles of Programming & Software Engineering.
C++ fundamentals.
Data Structures and Programming.  John Edgar2.
Introduction to Object-oriented programming and software development Lecture 1.
GENERAL CONCEPTS OF OOPS INTRODUCTION With rapidly changing world and highly competitive and versatile nature of industry, the operations are becoming.
MT311 Java Application Development and Programming Languages Li Tak Sing( 李德成 )
5.0 Objects First with Java A Practical Introduction using BlueJ Introduction to Computer Science I Instructor: Allyson Anderson.
CSCA48 Course Summary.
Introduction CS 3358 Data Structures. What is Computer Science? Computer Science is the study of algorithms, including their  Formal and mathematical.
Introduction. 2COMPSCI Computer Science Fundamentals.
CSE-C1 Algs & DS 1 CSE–C1 Algorithms and Data Structures 1 lecturer Dr.Matthew Montebello office CB 409 credit 1 lectures 10.
Prepared By Ms.R.K.Dharme Head Computer Department.
Introduction CS 3358 Data Structures. What is Computer Science? Computer Science is the study of algorithms, including their  Formal and mathematical.
Data Structures Using C++1 Chapter 1 Software Engineering Principles and C++ Classes.
Dale Roberts Object Oriented Programming using Java - Introduction Dale Roberts, Lecturer Computer Science, IUPUI Department.
1 CSCD 326 Data Structures I Software Design. 2 The Software Life Cycle 1. Specification 2. Design 3. Risk Analysis 4. Verification 5. Coding 6. Testing.
Learners Support Publications Object Oriented Programming.
Data Structures and Algorithms Dr. Tehseen Zia Assistant Professor Dept. Computer Science and IT University of Sargodha Lecture 1.
Data Structures Using C++ 2E
© 2006 Pearson Addison-Wesley. All rights reserved2-1 Chapter 2 Principles of Programming & Software Engineering.
© 2006 Pearson Addison-Wesley. All rights reserved 2-1 Chapter 2 Principles of Programming & Software Engineering.
Object-Oriented Programming © 2013 Goodrich, Tamassia, Goldwasser1Object-Oriented Programming.
Chapter 2 Principles of Programming and Software Engineering.
CSCE , SPRING 2016 INSTRUCTOR: DR. NANCY M. AMATO 1.
Data Structures and Algorithms in JAVA Chapter 2.
CH 1-4 : INTRODUCTION ACKNOWLEDGEMENT: THE SLIDES ARE PREPARED FROM SLIDES PROVIDED WITH DATA STRUCTURES AND ALGORITHMS IN C++, GOODRICH, TAMASSIA AND.
Maitrayee Mukerji. INPUT MEMORY PROCESS OUTPUT DATA INFO.
Advanced Data Structures Lecture 1
Principles of Programming & Software Engineering
Introduction to Algorithms
Data Abstraction: The Walls
Algorithms and Problem Solving
CSC 222: Computer Programming II
Visit for more Learning Resources
Programming Logic and Design Seventh Edition
The Development Process of Web Applications
Object-Oriented Programming
Ch. 2 Object-Oriented Programming
GC211Data Structure Lecture2 Sara Alhajjam.
Data Abstraction: The Walls
Principles of Programming and Software Engineering
OOP What is problem? Solution? OOP
About the Presentations
INTRODUCTION TO OBJECT-ORIENTED PROGRAMMING (OOP) & CONCEPTS
Object-Oriented Programming
Object-Oriented Programming
Subprograms and Programmer Defined Data Type
Ada – 1983 History’s largest design effort
Introduction to Computer Science for Majors II
Objects First with Java A Practical Introduction using BlueJ
Algorithms and Problem Solving
Introduction to Algorithms
Introduction to Data Structure
Objects First with Java A Practical Introduction using BlueJ
Basic Concepts of Algorithm
Oriented Design and Abstract Data Type
© 2016 Pearson Education, Ltd. All rights reserved.
Presentation transcript:

Lecture 2 of Computer Science II Design Principles Instructor: Mrs. Eman Alajrami

Agenda Data Structures and Algorithms Design Principles Agenda Data Structures and Algorithms Object oriented design principles. Object oriented design techniques. Java examples of object oriented design. Object oriented design patterns  Page 2

Data structures and algorithms Definitions Data Structures : systematic way of organizing and accessing data. Algorithm: a step by step procedure for performing some task in a finite amount of time. Algorithm Example: Algorithm LargestNumber Input: A non-empty list of numbers L. Output: The largest number in the list L. largest ← L0 for each item in the list L≥1, do if the item > largest, then largest ← the item return largest  Page 3

Data structures and algorithms High Level Design Goals Correctness. Efficiency. What are the features of a good computer program? It is essential that the program be correct, doing what it is supposed to do and containing no bugs. The program should be efficient, using no more time or memory than is necessary. The program should be general-purpose, so that we don't have to start from scratch the next time we build a similar program. Finally, all other things being equal, the program should be rapidly developed.  Page 4

Data structures and algorithms Implementation Goals Robustness. Adaptability. Reusability. Robustness Every good programmer wants to develop software that is robust, which means , capable of handling unexpected inputs that are not explicitly defined for its application. For example, if a program is expecting a positive integer (for example, representing the price of an item) and instead is given a negative integer, then the program should be able to recover gracefully from this error. Adaptability Modern software applications, such as Web browsers and Internet search engines, typically involve large programs that are used for many years. Software, therefore, needs to be able to evolve over time in response to changing conditions in its environment. Thus, another important goal of quality software is that it achieves adaptability (also called evolvability). Reusability Going hand in hand with adaptability is the desire that software be reusable, that is, the same code should be usable as a component of different systems in various applications.  Page 5

Object Oriented Design Principles 1. Abstraction Means to distill a complicated system down to its most fundamental parts and describe these parts in a simple, precise language. Benefits robustness since it leads to understandable and correct implementation.  Page 6

Object Oriented Design Principles 1. Abstraction ADT: is a mathematical model of a data structure that specifies the type of data stored, the operations on them, and the types of parameters of the operations. An ADT specifies what each operation does, but not how it does it. Examples in Java? ( Complex Numbers, Deque, lists, Trees, Queue, Set, Stack, ….. ) Benefits: Clarity, Robustness.  Page 7

Object Oriented Design Principles 2. Encapsulation The idea of encapsulation comes from : (i) the need to cleanly distinguish between the specification and the implementation of an operation and (ii) the need for modularity. You just know how to use it Benefits: Security. modularity  Page 8

Object Oriented Design Principles 3. Modularity Modularity refers to an organizing structure in which different components of a software system are divided into separate functional units. Benefits: Clarity. Reusability.  Page 9

Object Oriented Design Techniques 1. Classes and Objects Class: a specification of the data fields that the object contains, as well as of the operations that the object can execute. Objects: are simply instances of these classes.  Page 10

Object Oriented Design Techniques 2. Interfaces and Strong Typing In Java an interface is similar to an abstract class in that its members are not implemented. In interfaces, _none_ of the methods are implemented. There is no code at all associated with an interface.  Page 11

Object Oriented Design Techniques 3. Inheritance and Polymorphism Benefits of inheritance: Reduction of redundant code. Reusability of code Polymorphism: Inheritance. Overriding. Overloading.  Page 12

Java Examples of Object-Oriented Design Interface examples  Page 13

Java Examples of Object-Oriented Design Interface examples  Page 14