StudentShare
Contact Us
Sign In / Sign Up for FREE
Search
Go to advanced search...
Free

Object-Oriented Programming - Report Example

Cite this document
Summary
This report "Object-Oriented Programming" presents object-oriented programming that uses more time in program execution since the code is executed as a block. However, procedural programming breaks down the function into simpler functions that are executed in an easier manner…
Download full paper File format: .doc, available for editing
GRAB THE BEST PAPER91.7% of users find it useful
Object-Oriented Programming
Read Text Preview

Extract of sample "Object-Oriented Programming"

?Object Oriented Programming is the main drain in project development time due to its complexity 22 November Outline Object oriented programming Data structures in OOP Procedural programming Data Structures in Procedural Programming Object oriented programming versus procedural programming Code re-usability and Efficiency Conclusion References Object Oriented Programming Object oriented programming refers to a design philosophy that uses various sets of programming languages other than the previous procedural programming. Object oriented programming is mainly compromised of objects which are then used along the program implementation. Object oriented may also refer to a programming method that combines data and instructions into a self-sufficient object. (Castagna 1997, p113.) Object oriented programming is essentially based on four major distinguishing features namely: abstraction, encapsulation, inheritance, and polymorphism. Abstraction is simply defined as disregarding the extraneous functions, properties, or features and emphasizing the ones that are significant to the related program. Abstraction refers to taking the essential parts of the program and incorporating them into the program while putting away the parts of the program that may not be essential in the process of program development. Encapsulation in simple terms is summing up or rather putting together. Encapsulation is the way of assembling into a single object the data and the operations that affect the program’s data. Inheritance refers to the process of developing new and unique classes from the ones that have been existence. Inheritance also makes the new classes to acquire the attributes and behaviour of the previous classes. (Svenk 2003, p232.) The new attributes and behaviour of the former classes are incorporated into the new classes so as to suit their requirements. Inheritance may be either single or partial. Polymorphism is the capability of the program developed to perform similar operations on different types of objects. Each operation is implemented in a way that is apt to the objects that are in use in the program. Object oriented programming bundles procedures and data structures so that an object which is an illustration of class is able to operate on its own data structure. Polymorphism degree that is allowed varies and is of three major flavours referred to as parametric polymorphism, function overloading and sub-typing polymorphism. Parametric polymorphism allows the description of a class or function to be conceptual with respect to some set of types and is predominantly essential when describing abstract data type objects such as lists, arrays, queues, stacks, hash maps trees, graphs, and sets. Data stored in all these abstract data types is stored in a neutral way and is specified parametrically thus allowing the re-usability of the data. Parametric polymorphism allows a single function definition to be used with arguments of varying types. Parametric polymorphism is particularly useful in structural modelling due to the substantial number of parametric polymorphic modules. Function overloading allows the program to modify a function computation based on the types of its arguments as well as allowing a single function to be defined with many signatures. Function overloading helps improve the re-usability by increasing the applicability of the components involved thereof. It helps improve the applicability of the program in different fields since it can be applied in various modules seeing that the components are re-usable. The natural extension of functional overloading is to allow a component to identify various type signatures for its ports in the structural domain. Sub-typing is in such a manner that it allows a value of one type to be used in a place where a value of another type is a requirement so long as the first type is a subtype of the latter. This means that in function call, it is possible for data whose types are subtypes of the function types to be provided. This is preferred to supplying arguments of the types that have been specified in the signature of the function. Language subtype relation is used to define which types are subtypes of other types. It is possible to extend this relation through the use of sub classing though some segment of the subtype is preset by programming language. The use of sub-typing is not limited to calling of functions but may also be used in calling the constructor of an object. A member variable is used to store the object has been passed to another constructor of an object. The variable member functions act as clients of the object that has been passed. Data structures in Object Oriented Programming A data structure is a way of storing data in a computer so that it can be used efficiently. The data structures used mostly are arrays, lists, stacks, trees, graphs and queues. An array refers to adjacent indexed locations holding homogenous data. Data is stored in a sequential form in adjacent storage locations. An array allows access of data by index directly and placing data directly for storage. It is rigid and must have a name, size, and indexing. A list consists of a sequence of nodes, each containing arbitrary data fields and one or two references ‘links’ pointing to the next and/or previous nodes. A linked list is a self-referenced data-type because it contains a pointer or link to another data of the same type. Linked lists permit insertion and removal of nodes at any point in the list in constant time, but do not allow random access. Several different types of linked lists exist among them singly linked lists, doubly linked lists and circularly linked lists. (Hamilton 2002, p87.) A singly linked list or slist in short is a list with one link per node. This link points to the next node in the list, or to a null value or empty list if it is the final node. A doubly linked list or two-way linked list comprises of two links in each node. One of the link points to the previous, or points to a null value or empty list if it is the final node; and the other points to the next, or points to a null value or empty list if it is the final node. A circular list has both the head and the tail at one point. A stack is a special of data structure in which items are removed in the reverse order from that in which they have been added, so that the most recently added item is the first one removed. This is also called last-in, first out (LIFO). Adding an item to a stack is called pushing while removing an item from a stack is called popping. Items are removed or added from the top of the stack. A tree is a data structure accessed from the root node. Each node is either a leaf or an internal node. An internal node has one or more child nodes and is called the parent of its child nodes. All children of the same node are siblings. Contrary to a physical tree, the root is usually depicted at the top of the structure, with the leaves being depicted at the bottom. Binary trees have a maximum of only two branches from each node. Binary trees are traversed systematically using several techniques including breadth first and depth first. A graph is a set of items connected by edges. Each item is called a vertex or node. Formally, a graph is set of vertices with a binary relation between them commonly referred to as adjacency. A queue is type of data structure where the first item in the queue is the first item to leave the queue. Insert operation in queues is called enqueue while the operation of removing items is called dequeue. (Rajesh 2006, p121.) Object oriented programming is a well regarded and widely accepted technology in programming which has much potential for production improvement. It uses interrelating program objects which are independent entities which respond to messages. Object oriented programming is responsive to changes, enables functional compartmentalization within a system i.e. allows inclusion of all the resources needed to for the functionality of the object. It helps increase reusability and maintenance of service code. The code used can be tested and this enhances the quality of the output. Procedural programming Procedural programming, also called modular programming, is a type of programming language that is used to break down large procedures into smaller components commonly called modules or functions. It defines the steps that a program must take to reach a desired state. Any given procedure may be invoked at any point of program execution. (Summerfield 2009, p327.) This is usually called function calling and this may be done by other procedures or even by itself. There are occasional loops and branches during the program execution. The use of functions eliminates the need for redundant programming of the same instructions. Modular programs are easy to write and debug. The definitions of functions may appear in any order though the multiple functions contained in a program must be independent of one another. One function cannot be embedded within another. Information is passed to a function through special identities called arguments or parameters and is returned through the return argument. A void function returns nothing. A function has two components namely, declarator and function body. A declarator contains the value type returned by the function allowed by the function name; a set of components separated by commas and is enclosed in parameters. (Jones 2001, p135.) Each argument is preceded by its associated type declaration. The arguments are called formal arguments or formal parameters because they represent name of the data items that are transferred into the function from the calling position of the function. Omission of data type is considered poor programming practice even if data types are integers. Function body is the remainder or a function that defines the action to be taken by the function and it may contain compound statements, control statements or expression statements. Data structures in procedural programming Data structure as defined in procedural programming is a logical way of representing objects structurally. Among the data structures applied in procedural programming are arrays, lists, strings, stacks, queues graphs and trees. An array in procedural programming is a sequence of elements of the same type referenced using one variable name. An array has element, subscript and array type as its components. An array can either be single or multi-dimensional. A file is a typical large list stored in the external computer memory. A string is a set of sequence of characters which is finite. Summary of procedural programming Procedural programming implements the program as a series of instructions coding an algorithm. Coding is the process of converting a program design into a computer program which is done by writing the source code using a particular language. The characteristics of procedural programming are looping, selection, and sequence among others. Looping is a structure designed to execute the same block of codes several times until a certain condition is fulfilled. The three types are while loop, repeat-until loop and for loop. Selection is whereby a decision based on Boolean test has to be made before a computer executes either of the statements. In sequence, all the actions in the program execution must follow one another without skipping any. Procedural programming is easy to debug and the bugs involved are few. The algorithm in modular programming is easily understood and can be executed fast since many programmers can be employed on each module. Testing for bugs is relatively easy because each module is tested on its own. (Dik 1992, p97.) It allows programmers to specialize on particular areas hence the output is fast and the program is finished fast. In procedural programming, problems might arise due to variable names hence it is not flexible. Object Oriented Programming versus Procedural Programming Both are programming languages and have played a very important role in technological advancement. However, procedural programming is preferred to object oriented programming since it is easy to understand while object oriented programming may cause challenges in an attempt to understand its operation. (Ganesh 2007, p153.) Procedural programming does not use much space and is easily debugged but object oriented requires much space and the bugs are not that easy to note and debug. In procedural programming, a programmer creates functions and variables that work together though they are separated distinctly. (Moock 2004, p379.) Code re-usability and Efficiency Both procedural programming and object oriented programming allow code re-usage though the extent of re-use matters. In object oriented programming, code re-usage is far more effective than in procedural programming since object oriented programming was designed to enable code re-usability. Code –reusability in object oriented programming is enhanced through inheritance and composition. (Freeman 1987, p231.) However, even though re-usability in procedural programming is not that advanced, procedural programming remains the better option as a programming language. It is more efficient than object oriented programming because the execution of programs is fast owing to the fact that the complex modules are broken down into simper and workable functions. Conclusion Projects’ completion is all dependent on time taken to complete various tasks. Object oriented programming uses more time in program execution since the code is executed as a block. However, procedural programming breaks down the function into simpler functions that are executed in an easier manner. Though it uses more space, procedural programming is better than object oriented in terms of execution speed. Therefore, object oriented programming will make completion of a project take more time. References Castagna, G. (1997) Object oriented programming: a unified foundation, Berlin: Birkhauser Dik S. (1992) Functional grammar in Prolog: an integrated implementation for English, French, and Dutch: Berlin Walter de Gruyter Ganesh S. (2007) 60 Tips On Object Oriented Programming: India Tata McGraw-Hill Education Hamilton J. (2002) Object-oriented programming with Visual Basic .NET, Cambidge O’Reilly Media Moock C. (2004) Essential ActionScript 2.0: Cambidge O’Reilly Media Object-oriented programming: using C++ for engineering and technology, Svenk G. (2003): London Cengage Learning Programming in Python 3: A Complete Introduction to the Python Language, Summerfield M. (2009): Boston Addison-Weley Proffesional Rajesh A. (2006) Object oriented programming: concepts and implementation, New Delhi: Laxmi Publications Tutorial, software reusability, Freeman P. (1987): London Computer Society Press of the IEEE Visual Basic: A Complete Course, Jones P. (2001): London Cengage Learning Read More
Cite this document
  • APA
  • MLA
  • CHICAGO
(Object-Oriented Programming Report Example | Topics and Well Written Essays - 2000 words, n.d.)
Object-Oriented Programming Report Example | Topics and Well Written Essays - 2000 words. https://studentshare.org/logic-programming/1437204-object-oriented-programming-is-the-main-drain-in
(Object-Oriented Programming Report Example | Topics and Well Written Essays - 2000 Words)
Object-Oriented Programming Report Example | Topics and Well Written Essays - 2000 Words. https://studentshare.org/logic-programming/1437204-object-oriented-programming-is-the-main-drain-in.
“Object-Oriented Programming Report Example | Topics and Well Written Essays - 2000 Words”. https://studentshare.org/logic-programming/1437204-object-oriented-programming-is-the-main-drain-in.
  • Cited: 0 times

CHECK THESE SAMPLES OF Object-Oriented Programming

Object Oriented Programming

Traditionally, a computer program was seen as a collection of functions or procedures or simply a list of instructions whereas with the advent of Object Oriented programming, each program may be seen as comprising a collection of individual units, or objects, that act on each other.... OOP is an acronym for Object Oriented programming.... Traditionally, a computer program was seen as a collection of functions or procedures or simply a list of instructions whereas with the advent of Object Oriented programming, each program may be seen as comprising a collection of individual units, or objects, that act on each other....
4 Pages (1000 words) Essay

Computer Programming: The Advantages of Object Oriented Programming

The author also analyzes the statement that 'to operate' a computer is far easier, yet less powerful, than 'to program' a computer and discusses the advantages of Object-Oriented Programming.... hellip; An entry-level programming job is preferred by the students, new graduates, and part-time workers.... In this scenario, the entry-level programming job offers a basic step towards the enhancement of personal skills regarding the concerned profession....
6 Pages (1500 words) Assignment

Procedural programming languages and object oriented programming language

Procedural programming is simply an approach to programming and the… However it should be noted that it is possible to write an object oriented code using a procedural language like turbo C, similarly it Procedural programming languages and object oriented programming language Introduction: Object oriented languages and procedural programming languages are basically two different paradigms based on two different thought processes....
2 Pages (500 words) Essay

Object Oriented Programming

There are two paradigms that are followed to write computer programs: ‘procedural' or of the of the of the Object Oriented programming INTRODUCTION A Computer Program is a series of instructions that tells a computer what tasks it needs to perform and in what sequence.... The three main principles that lie at the core of Object Oriented programming are encapsulation, inheritance and polymorphism.... EXAMPLESPractical present day examples of Object oriented languages are narrated by Emden and Somoson (2006) as: “Pizza and GJava are examples of Multi-Paradigm Object Oriented programming Languages....
1 Pages (250 words) Research Paper

Object Oriented Programming

This is in marked contrast to procedural programming where program flow is given the central focus.... In object –oriented programming, the… These data elements are modeled as classes and they are active entities that can manipulate the data contained in themselves and in other classes.... Finally, the system behavior is modeled after the interactions of these data items of the of the of the Object Oriented programming Object oriented programming is a programming methodology, where data and its interactions are of central focus rather than processes....
1 Pages (250 words) Essay

OBJECTS AND OBJECT ORIENTED PROGRAMMING: CLASSES & OBJECTS, CLASSES & FUNCTIONS, CLASSES & METHODS

Class in which it is found is called the enclosing Objects and Object Oriented programming Introduction as used in object oriented programming is a group of things or objects that have the same characteristics.... onclusionIn object oriented programming, behaviors of the objects instantiated in the parent class are the methods.... Python 3 object oriented programming: Harness the power of Python 3 objects....
1 Pages (250 words) Essay

Object Oriented Programing Languages

This report "Object Oriented Programing Languages" discusses Object-Oriented Programming languages that are dominant in terms of programming languages.... The system which was effectively divided into a number of compositional subsystems was not very effective thus creating the need to formulate Object-Oriented Programming languages such as C++, C#, PHP, Python, Java, Perl, Ruby etcetera (Budd, 2008).... As a result, Object-Oriented Programming has led to programs that are easier to understand, easier to maintain, and most importantly, adaptable to evolution (Clark, 2013)....
15 Pages (3750 words) Report

Object-Oriented Programming Paradigm

The paper "Object-Oriented Programming Paradigm" will begin with the statement that class is a description of the behaviors of an object.... It's an atom of Object-Oriented Programming that covers the state and the behavior of data processing systems.... Property: Properties in most of the objected oriented programming languages are found between member data and member code of a class.... Role: Role in the programming field represents the functionality of an object....
11 Pages (2750 words) Assignment
sponsored ads
We use cookies to create the best experience for you. Keep on browsing if you are OK with that, or find out how to manage cookies.
Contact Us