Programming Paradigms Different paradigms Procedural paradigm, e.g. Pascal Basic Functional paradigm, e.g. Lisp Declarative paradigm, e.g. Prolog Object-Oriented.

Slides:



Advertisements
Similar presentations
An Introduction to Visual Basic Terms & Concepts.
Advertisements

Department of Computer Engineering Faculty of Engineering, Prince of Songkla University 1 5 – Abstract Data Types.
Chapter 1: An Introduction to Visual Basic 2012
OBJECT ORIENTED PROGRAMMING M Taimoor Khan
Solutions to Review Questions. 4.1 Define object, class and instance. The UML Glossary gives these definitions: Object: an instance of a class. Class:
Ch 12: Object-Oriented Analysis
Systems development life cycle & development methodologies
Chapter 1 Object-Oriented System Development
UML – Class Diagrams.
Chapter 6 Graphical User Interface (GUI) and Object-Oriented Design (OOD)
Object Oriented System Development with VB .NET
Basic OOP Concepts and Terms
Java Programming, 3e Concepts and Techniques Chapter 1 An Introduction to Java and Program Design.
©TheMcGraw-Hill Companies, Inc. Permission required for reproduction or display. Chapter 1 Introduction to Object-Oriented Programming and Software Development.
Visual Basic Introduction IDS 306 from Shelly, Cashman & Repede Microsoft Visual Basic 5: Complete Concepts and Techniques.
Chapter 13: Object-Oriented Programming
©TheMcGraw-Hill Companies, Inc. Permission required for reproduction or display. Chapter 1 Introduction to Object-Oriented Programming and Software Development.
1 An Introduction to Visual Basic Objectives Explain the history of programming languages Define the terminology used in object-oriented programming.
C++ fundamentals.
Distribution of Marks Internal Sessional Evaluation Assignments – 10 Quizzes – 10 Class Participation Attendence – 5 Mid – Term Test – 25 External Evaluation.
1 Object-Oriented Software Engineering CIS 375 Bruce R. Maxim UM-Dearborn.
BACS 287 Basics of Object-Oriented Programming 1.
Programming Paradigms Imperative programming Functional programming Logic programming Event-driven programming Object-oriented programming A programming.
Chapter 6: Graphical User Interface (GUI) and Object-Oriented Design (OOD) J ava P rogramming: Program Design Including Data Structures Program Design.
Introduction To System Analysis and design
Java Programming, 2E Introductory Concepts and Techniques Chapter 1 An Introduction to Java and Program Design.
CSM-Java Programming-I Spring,2005 Introduction to Objects and Classes Lesson - 1.
Microsoft Visual Basic 2005: Reloaded Second Edition
Introduction to Object-oriented programming and software development Lecture 1.
Object Oriented Programming Lecturer: Andreas P. Adi
Design Patterns OOD. Course topics Design Principles UML –Class Diagrams –Sequence Diagrams Design Patterns C#,.NET (all the course examples) Design Principles.
An Object-Oriented Approach to Programming Logic and Design
OBJECT ORIENTED PROGRAMMING CONCEPTS ISC 560. Object-oriented Concepts  Objects – things names with nouns  Classes – classifications (groups) of similar.
Sadegh Aliakbary Sharif University of Technology Fall 2011.
An Introduction to Visual Basic
Chapter 8: Writing Graphical User Interfaces
CHAPTER ONE Problem Solving and the Object- Oriented Paradigm.
Java Programming: From Problem Analysis to Program Design, Second Edition1  Learn about basic GUI components.  Explore how the GUI components JFrame,
Introduction To System Analysis and Design
An Introduction to Java Chapter 11 Object-Oriented Application Development: Part I.
Chapter 6 Object-Oriented Java Script JavaScript, Third Edition.
© 2009 Pearson Education, Inc. Publishing as Prentice Hall 1 Chapter 15: Object-Oriented Data Modeling Modern Database Management 9 h Edition Jeffrey A.
© 2011 Pearson Education, Inc. Publishing as Prentice Hall 1 Chapter 13 (Online): Object-Oriented Data Modeling Modern Database Management 10 th Edition.
Object-Oriented Design Simple Program Design Third Edition A Step-by-Step Approach 11.
Class Diagrams In UML class diagrams are used to represent classes and relationships between classes. Each class is represented as a box divided into three.
Basic OOP Concepts and Terms. In this class, we will cover: Objects and examples of different object types Classes and how they relate to objects Object.
UML The Unified Modeling Language A Practical Introduction Al-Ayham Saleh Aleppo University
1 Programming Paradigms Object Orientated Programming Paradigm (OOP)
CS 3050 Object-Oriented Analysis and Design. Objectives What is “Object-Oriented?” Object-Oriented Approach Vs. Structured Approach How Has the Object-Oriented.
Programming Paradigms Lecturer Hamza Azeem. What is PP ? Revision of Programming concepts learned in CPLB Learning how to perform “Object-Oriented Programming”
Java Programming: From Problem Analysis to Program Design, 3e Chapter 6 Graphical User Interface (GUI) and Object-Oriented Design (OOD)
 Objects versus Class  Three main concepts of OOP ◦ Encapsulation ◦ Inheritance ◦ Polymorphism  Method ◦ Parameterized ◦ Value-Returning.
Java Programming: From Problem Analysis to Program Design, Second Edition1 Lecture 5 Objectives  Learn about basic GUI components.  Explore how the GUI.
Chapter 12: Computer Programming 1 Computer Programming Chapter 12.
Copyright © 2010 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Starting Out with Programming Logic & Design Second Edition by Tony Gaddis.
Introduction to Classes, Objects, Methods and Attributes Lecture # 5.
Lesson 1 1 LESSON 1 l Background information l Introduction to Java Introduction and a Taste of Java.
OOPS CONCEPT.  OOPS  Benefits of OOPs  OOPs Principles  Class  Object Objectives.
Chapter 6 Graphical User Interface (GUI) and Object-Oriented Design (OOD)
Copyright © 2010 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Starting Out with Programming Logic & Design Second Edition by Tony Gaddis.
CSCE 240 – Intro to Software Engineering Lecture 3.
Object-oriented programming (OOP) is a programming paradigm using "objects" – data structures consisting of data fields and methods together with their.
Object Oriented Programming
Sachin Malhotra Saurabh Choudhary
Programming in Java Sachin Malhotra, Chairperson, PGDM-IT, IMS Ghaziabad Saurabh Chaudhary, Dean, Academics, IMS Ghaziabad.
An Introduction to Visual Basic
Computer Programming.
Chapter 12: Computer Programming
Basic OOP Concepts and Terms
Presentation transcript:

Programming Paradigms Different paradigms Procedural paradigm, e.g. Pascal Basic Functional paradigm, e.g. Lisp Declarative paradigm, e.g. Prolog Object-Oriented paradigm, e.g. C++, Java Main advantage of object-oriented programming (OOP) is reuse.

Object-Oriented Design (OOD) The first step of object-oriented programming (OOP) is OOD. OOD will be written in UML (Unified Modeling Language) Writing an object-oriented program: Construct an OOD Convert the OOD to a particular programming language

OOD Concepts Objects classes instances of classes Association Inheritance superclasses subclasses

What is an object? OOP involves defining a number of objects. Objects consist of attributes and operations that can be applied to the data. The attributes of an object can only be accessed via these operations. The operations are used to access and update/change the data. Objects are transient, i.e. the data and operations of an object only remain in memory for the duration the program is run.

student Object Attributes Name Student number Address Matric points Degree Operations Set name, student number, address, matric points or degree Get name, student number, address, matric points or degree Print student information

customer Object Attributes Name Address Phone Balance Operations Set name, address, phone or balance Get name, address, phone or balance Update balance Print customer details

Classes and Instances A class defines the overall internal structure, i.e. attributes and operations, of the object. Class definition Attributes called data elements Operations called methods An instance of a class which has specific values for the different data elements. One of the data elements my be used to identify each element uniquely, e.g. a student number.

Instance of the student class Name: B. Green Student Number: Address: WOB Residence Matric Points: 45 Degree: B.Sc

Encapsulation Classes are said to exhibit “information hiding” due to the fact that the internal structure of the class is hidden. The data elements of an instance of the class is manipulated be means of an interface, e.g. the Formatter and Keyboard classes. This is referred to as encapsulation.

Class Diagrams In UML class diagrams are used to represent classes and relationships between classes. Each class is represented as a box divided into three parts specifying the: Name of the class Data elements of the class Attributes of the class

The student class Class name Data elements Methods

Example 1 Define the classes that you would use for the following system. Specify the data elements and methods of each class. You need to develop a system that keeps track of customers accounts. Information stored for each customer is the customer name, address and phone number. A customer may place one or more orders. Each order has an order number, date and amount and a description of the product to be shipped. Each product has a unique product number, description and price.

Example 2 Define the classes that you would use for the following system. Specify the data elements and methods of each class. You are required to develop a GUI for an existing application. The main component of the GUI is a form. The form has a width, height, boarder style and background color. The user must be able to display or close a form. The user must also be able to minimize and maximize the form. The form contains labels and buttons. Labels have a size, shape, color and text. The programmer must be able to set the text, get the text, hide the label or display the label. Each button has a size, shape, colour, location and caption. The user should be able to click the button. A programmer must be able to hide, display, enable or disable the button.