Question

In: Computer Science

Compare and contrast (1) the procedural/functional approach (defining a function for each operation with the function...

Compare and contrast (1) the procedural/functional approach (defining a function for each operation with the function body providing a case for each data variant) and (2) the object-oriented approach (defining a class for each data variant with the class definition providing a method for each operation). (250 own words)

Solutions

Expert Solution

Difference between Procedural/ functional approach and the object oriented approach.

In procedural approach a function is defined for each operation with the function body providing a case for each data variant and in object oriented approach a class is defined for each data variant with the class definition providing a method for each operations.

The major differences are given below.

SI No.

Approach

Procedural Approach

Object Oriented Approach

1

Design

Define a procedure or function for all operations and call them during evaluation. The concept used is structured programming

The programs are designed using the concept of Objects, which contains data in the form of attributes and codes.

2

Division

Here the program is divided into functions

Here the program are divided into objects

3

Model

Follows declarative programming model

Follows imperative programming model

4

Execution

Follows a systematic step by step approach to execute methods and functions

Various functions can call simultaneously

5

Process

The approach used in procedural oriented programming is Top Down Approach

The approach used is Bottom Up Approach

6

Linking

Different part of the program are interconnected by parameter passing

The functions of the objects are connected by message passing

7

Data sharing

Global data is shared among the functions

Data is shared among the objects through the member function

8

Importance

Give more importance to function than data

Give more importance to data than function

9

Security

Less secure, in the sense that there is no proper way for data hiding

Highly secure, data hiding is there

10

Overloading

Both operator overloading and function overloading are not supported in procedure approach

Overloads functions, operators and constructor

11

Inheritance

There is no provision of inheritance and hence there is no concept of access specifiers

Inheritance is used with the concept of access specifiers like private, public and protected are used here

12

Support

Support parallel programming

Does not support parallel programming

13

Modification

Adding a new function is not easy

Adding a new object is easy

14

Based on

Based on unreal world

Based on real world

15

Example

Eg. C, Fortan, Pascal, Basic

Eg. C++, Java, Python

From the table it is clear that Object oriented approach has a little edge over Procedural approach in the sense of data security, ease of use, accessibility etc.


Related Solutions

Compare and contrast security functional requirements and functional securiydesign principles.
Compare and contrast security functional requirements and functional securiydesign principles.
Compare and contrast the Newtonian and Galilean telescope designs. Explain the operation of each using your...
Compare and contrast the Newtonian and Galilean telescope designs. Explain the operation of each using your knowledge of optics. Illustrate the operation of each device using ray diagrams. Describe the advantages and disadvantages of each type. Make sure to include: - A description of Newtonian and Galilean telescope designs in detail. - Compares and contrasts the design, functions, advantages, and disadvantages of each telescope. - Applies knowledge of lenses and or mirrors to explain how the telescope works. Explanation includes...
Compare and contrast the four types of memory; episodic memory, semantic memory, working memory, and procedural...
Compare and contrast the four types of memory; episodic memory, semantic memory, working memory, and procedural memory.
compare and contrast the managerial grid and the four framework approach
compare and contrast the managerial grid and the four framework approach
Compare and contrast the Earnings per Share approach and the Discounted Cash flow approach to value...
Compare and contrast the Earnings per Share approach and the Discounted Cash flow approach to value securities in the stock market.
Question: • Compare and contrast Donald Trumps approach to Covid-19 with the approach taken by Jacinder...
Question: • Compare and contrast Donald Trumps approach to Covid-19 with the approach taken by Jacinder Ardern. • How did Trump and Arden’s leadership styles effect the impact of Covid-19 in the USA and New Zealand? 1000 or less as much you can
define traditional approach to disease prevention. compare and contrast the social determinants of health approach with...
define traditional approach to disease prevention. compare and contrast the social determinants of health approach with the traditional apporach.
compare and contrast a purely secular and the biblical approach to principles of management
compare and contrast a purely secular and the biblical approach to principles of management
Briefly compare and contrast Katz ADLS Functional Assessment tool with Lawton IADL Functional Assessment tool. See...
Briefly compare and contrast Katz ADLS Functional Assessment tool with Lawton IADL Functional Assessment tool. See your text for these tools. Chapter 31 What role does a functional assessment tool have in planning for care of an individual? Why would one use one and not the other? Refer to JARVIS chapter 31
Compare and contrast an all-hazards approach with a scenario planning approach. Which approach best fits local-level...
Compare and contrast an all-hazards approach with a scenario planning approach. Which approach best fits local-level government? Which approach best fits the state- and federal-level governments? Explain your answer.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT