Kategorien: Alle - classes - inheritance - attributes - behavior

von farah wadi Vor 4 Jahren

169

INTRODUCTION TO OBJECT- ORIENTED PROGRAMMING (OOP)

Object-Oriented Programming (OOP) represents a paradigm shift from structured programming by emphasizing data and objects over functions and sequences. Central to OOP are several key concepts and terminologies.

INTRODUCTION TO OBJECT- ORIENTED PROGRAMMING (OOP)

INTRODUCTION TO OBJECT- ORIENTED PROGRAMMING (OOP)

1.2 Object oriented concept & terminologies

Classes and object
Object

What does it consist of?

fresh papaya, yogurt, whole milk, honey, cardamomuncooked rice, cinnamon bars, water, almonds, coconut juice, sugar, lime, ice, mint leavesdried boba tapioca pearls, water, sugar, almond milk, fruit juiceiced coffee, horchata, sugarmatcha powder, honey, milk, riceOther

instance of a class

Class

What cold drink will you serve?

papaya lassi with cardamomcoconut-rice coolerboba and bubble teaicy cool cochatamatcha shakeOther

A class is a template or blueprint to create an object

Features of OOP
Polymorphism
Inheritance
Encapsulation
Data Abstraction
Structured Programming VS OOP
OOP

Classes and objects can be reused easily

Main component of a program is objects

The importance is given to data

Structured programming

Difficult to reuse the functions

Main component of a program is functions

The importance is given to the sequence

UML (Unified Modeling Language)
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
Graphical language designed to capture the artifacts of an OOAD process
Car object
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.
Object,attribute,behaviour
Behavior

These might be called methods/member functions/even messages

Operation/function that an object can perform

How does it taste?
What is its flavor? Type in the adjectives that best describe this drink.
Example: 'Although sugar-free, this cider will warm your body and senses with its sweetish ginger and honey taste. It's a refreshing winter version of your beloved lemonade.'

Attributes

What does it consist of?

hot cocoa mix, mint chocolate chip ice-cream, fresh mintheavy cream, sugar, nutmeg, eggsnavel orange, apple cider, honey, berries, whole cloves, ground nutmeg, ginger, cinnamon stickscardamom seeds, cloves, black peppercorn, cinnamon sticks, ginger, milk, black tea, sugarvanilla soy milk, espresso, canned pumpkin, cinnamon, cayenne, agave syrup, saltOther

Data values are called properties/member variable/member data but in UML,the proper term is attributes

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

Objects

What hot drink will you serve?

peppermint hot chocolateeggnogwarm apple ciderchai teavegan pumpkin spice latteOther

example:

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

An instance/specific example of a class

1.1 Programming Techniques

OOAD
Disadvantages

Without an explicit reuse procedure this methodology do not lead to successful reuse on a large scale

Most of our project development teams are familiar with traditional analysis and design

all time it is not easy to determine all the necessary classes and objects required for a system

How does it taste?

What is its flavor? Each dish description should sound as if you were explaining a friend the taste and flavors for which that dish is your favorite. Type in the adjectives that best describe this course.

Example: ' The mascarpone cream has a mild, delicate texture. The exquisite after-taste is also given by the mix between the coffee and the hazelnut-vanilla-flavored Marsala wine.'

Advantage

What does it consist of

flour, baking powder, salt, white sugar, milk, eggs, buttercanola oil spray, eggs, vanilla cream, flour, cocoa powder, baking powder, dark chocolate, icing sugar mixture, Frangelico liquerlour, almonds, icing sugar, butter, eggs, caster sugar, cream, lemonscoffee, marsala, eggs, mascarpone, sponge fingers, cocoa powderbananas, vanilla ice-cream, pecans, dark chocolate, KahluaOther

Improves the quality of the system due to program reuse

Reduce the development time and cost

Provide reusability

Easy to maintain

Easy to understand

Object-oriented analysis and design (OOAD)

Dessert is the final course that is meant to satisfy people's cravings for sweetness after they have eaten other savorous foods. Type in the answer.

pancakeschocolate moussebaked lemon meringue pietiramisubanana splitOther

Applied throughout the development life cycle to foster better product quality and even encouraging stakeholder participation and communication

combination of OOA and OOD

OOD
Implemtatation details generally includes

Implementation of associations

Implementation of control

Implementation of methods

What is its flavor?
Each dish description should sound as if you were explaining a friend the taste and flavors for which that dish is your favorite.
Type in the adjectives that best describe this course.
Example: ' The crunchy tortillas are melting in your mouth like savoury-salty biscuits. The sweet-and-sour tomato sauce is perfectly seasoned while the jalapeno pepper makes it spicy. '

Restructuting the class data

How does it taste?
Each dish description should sound as if you were explaining a friend the taste and flavors for which that dish is your favorite. Type in the adjectives that best describe this course. Example: ' The taste of the citrus sauce is so syrupy and flavored, the exact amount of sweetness the duck needs. Also, the duck is tender and succulent in the inside and crispy on the outside.'

Defining the components,interfaces,objects,classes attributes and operations that will sastisfy the requirements

The main course, also called the entree, is the largest portion of the meal and in many cases contains some type of protein. Type in the answer.

gorgonzola and apple pork chopsbaked salmon with brown riceorange duck with mashed potatoesroasted turkey with grilled vegetablescurry chicken with broccoli puréeOther
Object-oriented Design
OOA
Clarifies and documents requirements of a system
Process of defining the problem in terms of real-world objects with which the system must interact

What does it consist of?

water, bacon, olive oil, carrots, onions, celery, potatoes, salt, pepperwater, sweet onions, chicken broth, butter, pepper, flour, milk, Cheddar cheese, parsleywater, beef chuck roast, onions, paprika, carrots, parsley, potatoes, caraway seeds, hot paprika, pepper, saltwater, chicken, vegetable oil, celery, carrots, chicken broth, parsley, fresh thyme, egg noodles, pepper, saltwater, dashi granules, miso paste, tofu, green onionsOther
Object-Oriented Approach

A soup can be anything from a light broth to a rich pure. Very often, the type of soup being served is determined by the following dish.
Type in the answer.

bacon souponion cream soupgoulash soupchicken noodle soupMiso soupOther

Helps organize complex programs easily

Java support OOA

OOP Techniques
Procedural Programming

What does it consist of?

butter, cream cheese, spinach, sour cream, Parmesan, saltgoat cheese, blue cheese, Cheddar cheese, Parmesan, grapes, nuts, dried appleflour tortillas, lean ground beef, chilly, tomato sauce, sour creamtoasted wheat bread, red onion, arugula, Swiss cheese, turkey ham, grainy mustardtortilla chips, Cheddar cheese, onion, sweet-sour tomato sauceOther

Programming model which is derived from structured programming

Object-oriented programming is a method of programming based on a hierarchy of classes

The appetizer, also called a starter, is a small portion or a bite-size delicacy which will prepare you for the remainder of the meal. Type in the answer.


dipscheese traysmini tacossandwichesnachosOther