Programming Methodologies PDF

Document Details

GratefulSwan3091

Uploaded by GratefulSwan3091

University of Papua New Guinea

Tags

programming methodologies structured programming object-oriented programming computer science

Summary

This document provides a basic overview of programming methodologies, covering structured programming, object-oriented programming, and event-driven programming. It explains the fundamental concepts within each approach.

Full Transcript

Programming Methodologies 1  Programming methodologies are different approaches or set of practices followed to write a program  Structured Programming  Object Oriented Programming  Event Driven Programming Structured Programming...

Programming Methodologies 1  Programming methodologies are different approaches or set of practices followed to write a program  Structured Programming  Object Oriented Programming  Event Driven Programming Structured Programming 2  A methodology that enforces a logical structure on the program being written.  Program is divided into simpler modules, each module will be performing a specific task. Flow controls used in structured programming 3  Sequential – Instructions are executed in sequence from the top to bottom of the program.  Test – Out of many modules, any one is executed, depending on the conditions specified. The conditions are specified by statements such as if..else and switch..case  Iterative – A module is executed until the specified condition is valid. The condition is specified using keywords such as for, while and do-while Advantages of Structured programming 4  It uses the top-down approach in which a big program is viewed as a collection to many smaller modules, thus making the program look simpler and easier to understand.  Many programmers can simultaneously work on a large program, with each working on a different module to reduce the development time.  The modules developed for one program can be reused in other programs requiring the same task.  Since a procedure is designed to perform just one task, each procedure can be checked individually, which makes debugging easier. Object Oriented Programming 5  Object Oriented Programming is a methodology in which the program is modeled on the concepts of objects and their interactions. OOPs Fundamental concepts  Class: A class is a template from which the objects are derived.  It describes the abstract characteristics and behaviors of an object. For example:  Consider the following species cats, dogs tiger, lion etc. all are objects of the class “Animals”  Classes provide modularity in an object oriented program. OOPs Fundamentals(continued) 6  Object: Object is a derivative of a class. Each object is described by a set of attributes known as its state and behavior.  Function: It is a logical sequence that describes an object’s abilities or functionality.  Message Passing: The process by which an object sends data to another object to invoke a function.  Inheritance: The object oriented methodology which makes it possible to define subclasses of data and objects that may share some or all of the main class’s characteristics. It helps in reducing development time. Advantages of OOP 7  The objects created for one program can be used in another program for performing similar functions. This code reusability function helps to reduce development time.  The inheritance feature of OOP makes it easy to maintain and modify existing code, as new objects and classes can be created by making small changes to existing ones.  OOP helps in hiding the implementation details from the user, which increases data security. Only the interface of the system is visible to the user.  This type of programming provides built-in code libraries that are useful for developing graphical user interfaces. Event driven programming 8  It is a programming methodology in which the flow of the program is determined by user actions, such as mouse clicks, key presses and messages received from other programs.  The user actions and message from other programs are known as events.  An event-driven program is made upon many event handlers which are sub-routines that handles the event generated.

Use Quizgecko on...
Browser
Browser