Kategorier: Alle - encapsulation - abstraction - design - inheritance

av ALIYA NATASHA 4 år siden

302

INTRODUCTION TO OBJECT- ORIENTED PROGRAMMING (OOP)

Object-Oriented Programming (OOP) is a programming paradigm that focuses on using objects and classes to design and build applications. Key features of OOP include data abstraction, which highlights essential data while hiding non-essential details; polymorphism, which allows objects to take on multiple forms; inheritance, where classes can inherit properties from other classes; and encapsulation, which combines data and methods into a single unit or class.

INTRODUCTION TO OBJECT- ORIENTED PROGRAMMING (OOP)

INTRODUCTION TO OBJECT- ORIENTED PROGRAMMING (OOP)

In linguistics, syntax is the set of rules, principles, and processes that govern the structure of sentences in a given language, usually including word order.

Features of OOP

A compound sentence is a sentence that has at least two independent clauses joined by a comma, semicolon or conjunction. An independent clause is a clause that has a subject and verb and forms a complete thought.

Polymorphism
Refers to the ability of an object to take on many form. Eg: buttons on remote control.
Inheritance
Refers to the concept by which one class derives the properties of another class.
Encapsulation

Create your own compound sentences, using the coordinators above.

Refers to the mechanism of wrapping up of data and methods (that operate on the data) into a single unit (class).
Data Abstraction

When independent clauses are joined with coordinators (also called coordinating conjunctions), commas and semicolons, they do more than just join the clauses. They add meaning and flow to your writing.

Refers to the concept of representing only the essential features of a data without including the non-essential details.

Object oriented concept & terminologies

A complex sentence is a sentence that contains an independent clause and one or more dependent clauses.

An independent clause can stand alone as a sentence, but a dependent clause even though it has a subject and a verb cannot stand alone.

UML

Attributive clauses serve as an attribute to a noun (pronoun) in the main clause. This noun or pronoun is called the antecedent of the clause.

provides you with a way to create and document a model of a system.
provides a comprehensive notation for communicating the requirements, behavior, architecture, and realization of an Object-Oriented design.
UML (Unified Modeling Language) is a graphical language designed to capture the artifacts of an OOAD process.
Car Object

An adverbial clause is a group of two or more words that function as an adverb in a sentence.

Car is a real world object and it has its own characteristics like colour of the car, size, model of the car, engine capacity and so on.
Classes and Objects

An appositive clause follows another noun or noun phrase in apposition to it; that is, it provides information that further identifies or defines it.

Classes and objects are building blocks of OOP approach.

Behaviour of objects are called as methods or member functions of a class.

Characteristics of real world object are variables or data members in a class.

Is an instance of a class.

Class

A class is a template or blueprint to create an object.

Behavior

The subject clause is a dependent clause that acts as a subject.

operation or function that an object can perform.
Attributes

A predicative clause may be introduced by conjunctions - that, whether, whether... or, as, as if, as though, because, lest, the way - or connectives.

The latter may be conjunctive pronouns - who, whoever, what, whatever, which - or conjunctive adverbs - where, wherever, when, whenever, how, why.

Data value or state that describes an object and helps you to tell one object from another of the same class
Object

The object clause is a phrase on which a verb performs an action. It falls at the end of a sentence, and is governed by a verb or a preposition.

An instance or specific example of a class.

Example

If Cat is the class, then Betsy, Ladi, Patches, Jake, Radar, and Frosty are specific instances of the class found in my house

What is OOAD?

Disadvantages of OOAD
Without an explicit reuse procedure this methodology do not lead to successful reuse on a large scale
difficult to complete a solution within estimated time and budget
not easy to determine all the necessary classes and objects required for a system
Advantages of OOAD
improves the quality of the system due to program reuse
reduce the development time & cost
provides re-usability
easy to maintain. Due to its maintainability OOAD is becoming more popular day by day
easy to understand.
Object-oriented analysis and design (OOAD) is a technical approach used in the analysis and design of an application / system.
and even encouraging stakeholder participation and communication.
applied throughout the development life cycle to foster better product quality and even encouraging stakeholder participation and communication.
Combination of OOA and OOD approach

What is OOA?

Object-Oriented Analysis (OOA) is the process of defining the problem in terms of real-world objects with which the system must interact.
It clarifies and documents the requirements of a system.
The primary tasks in OOA are

Describing how the objects interact

Defining the behaviour/ function of the objects

Defining the object attributes

Organizing the objects

Identifying objects

What is OOD?

Object-Oriented Design (OOD) is the process of defining the components, interfaces, objects, classes, attributes, and operations that will satisfy the requirements.

See the example below and try to create your own simple sentences.

Tim drives.

The implementation details generally include

Subtopic

Implementation of associations

Implementation of control

Implementation of methods

Restructuring the class data

Programming Techniques

Languages used in Procedural Programming

An adverbial is an individual word (that is, an adverb), a phrase, or a clause that can modify a verb, an adjective, or a complete sentence.

BASIC, Pascal and C
FORTRAN, ALGOL, COBOL
Procedural Programming

The attribute is defined as a quality or characteristic of a person, place or thing.

Defined as a programming model which is derived from structured programming, based upon the concept of calling procedure.
Object-Oriented Approach

The predicative is defined as an adjective or noun forming or contained in the predicate.

Its main trait is that it serves to express a property that is assigned to a 'subject'.

For e.g.: The dog is old.

Implements the real life aspects in programming.
Helps to organize complex programs easily.
Languages used in Object Oriented Programming

Traditional grammar defines the object in a sentence as the entity that is acted upon by the subject.

Objective-C, Dart, Swift, Scala
PHP, JavaScript, Ruby, Perl

The indirect object identifies the person/thing for whom/which the action of the verb is performed.

The indirect object is usually a person or a thing.

Java, C++, C#, Python

The direct object is the receiver of the action mentioned in the sentence.

Object Oriented Programming Techniques

The subject of a sentence is the person, place, thing, or idea that is doing or being something. You can find the subject of a sentence if you can find the verb.

Ask the question, 'Who or what 'verbs' or 'verbed'?' and the answer to that question is the subject.

A method of programming based on a hierarchy of classes, together with well-defined and cooperating objects