Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

Procedural Programming and Object-Oriented Programming, Summaries of Network Design

An overview of two major programming paradigms: procedural programming and object-oriented programming (oop). It discusses the key features, advantages, and disadvantages of each paradigm. Procedural programming is described as a linear, top-down approach where the program is divided into procedures or functions. It is suitable for general-purpose programming and has advantages like code reusability and easy program flow tracking, but can be harder to write and less secure. Object-oriented programming, on the other hand, organizes software design around data or objects rather than functions and logic. It offers benefits like improved software maintenance, faster development, and better quality through detailed testing, but can also be more complex and lead to slower-running programs. The document also touches on the relationship between these two programming paradigms and their practical applications in software development.

Typology: Summaries

2021/2022

Uploaded on 08/19/2022

hoang-nghia-duong-btec-hn
hoang-nghia-duong-btec-hn 🇻🇳

4 documents

1 / 17

Toggle sidebar

Related documents


Partial preview of the text

Download Procedural Programming and Object-Oriented Programming and more Summaries Network Design in PDF only on Docsity! ASSIGNMENT 2 FRONT SHEET Qualification BTEC Level 5 HND Diploma in Computing Unit number and title Unit 1: Programming Submission date Date Received 1st submission Re-submission Date Date Received 2nd submission Student Name Student ID Class Assessor name Student declaration I certify that the assignment submission is entirely my own work and I fully understand the consequences of plagiarism. I understand that making a false declaration is a form of malpractice. Student’s signature Grading grid P2 P3 P4 P5 M2 M3 M4 D2 D3 D4 ❒ Summative Feedback: ❒ Resubmission Feedback: Grade: Assessor Signature: Date: Lecturer Signature:  A large program is divided into subroutines, each of which can be called one or more times in any order.  Most functions use common data  Data in the system is moved from one function to another.  Function that converts data from one form to another  Using a top-down approach in program design I.1.1 Advantages and disadvantages: Procedural Programming comes with its own set of pros and cons, some of which are mentioned below.  Advantages: - Procedural Programming is excellent for general-purpose programming. - The coded simplicity along with ease of implementation of compilers and interpreters. - A large variety of books and online course material available on tested algorithms, making it easier to learn along the way. - The source code is portable, therefore, it can be used to target a different CPU as well. - The code can be reused in different parts of the program, without the need to copy it. - Through Procedural Programming technique, the memory requirement also slashes. - The program flow can be tracked easily.  Disadvantages: - The program code is harder to write when Procedural Programming is employed. - The Procedural code is often not reusable, which may pose the need to recreate the code if is needed to use in another application. - Difficult to relate with real-world objects. - The importance is given to the operation rather than the data, which might pose issues in some data-sensitive cases. - The data is exposed to the whole program, making it not so much security friendly. There are different types of programming paradigm as we mentioned before, which are nothing but a style of programming. It is important to understand that the paradigm does not cater to a specific language but to the way the program is written. Below is a comparison between Procedural Programming and Object-Oriented Programming. https://hackr.io/blog/procedural-programming 2. Event Driven Programming: Event-driven programming is a paradigm where entities (objects, services, and so on) communicate indirectly by sending messages to one another through an intermediary. The messages are typically stored in a queue before being handled by the consumers. Unlike in using direct calls, event-driven programming completely decouples the producer from the consumer, leading to some noteworthy benefits. For example, multiple producers and multiple consumers can all collaborate to process incoming requests. Retrying failed operations and maintaining an event history are also simplified. Event-driven programming also makes it easier to scale large systems, adding capacity simply by adding consumers. Let's look at the actors of event-based systems: events, producers, consumers, and message queues. 2.1 Characteristics of object-oriented programming: Abstraction Inheritance Encapsulation Polymorphism 2.1.1 Advantages and disadvantages:  Advantages: a. Flexibility: Programmers that use event-driven can be altered easily if the programmer wants something to be changed. This paradigm allows the programmer to produce a form of their requirements. Programmers who are event-driven can be put together without too many problems and also the code and design can be easily altered because if something isn't right. Possible tight coupling between the event schema and the consumers of the schema. g. Blocking: Reasoning about blocking operations might be becoming more difficult. https://aiven.io/blog/introduction-to-event-based-programming https://benchpartner.com/advantages-and-disadvantages-of-event-driven-programming 3. Object Oriented Programming: Object-oriented programming (OOP) is a computer programming model that organizes software design around data, or objects, rather than functions and logic. An object can be defined as a data field that has unique attributes and behavior. OOP focuses on the objects that developers want to manipulate rather than the logic required to manipulate them. This approach to programming is well-suited for programs that are large, complex and actively updated or maintained. This includes programs for manufacturing and design, as well as mobile applications; for example, OOP can be used for manufacturing system simulation software. The organization of an object-oriented program also makes the method beneficial to collaborative development, where projects are divided into groups. Additional benefits of OOP include code reusability, scalability and efficiency. The first step in OOP is to collect all of the objects a programmer wants to manipulate and identify how they relate to each other -- an exercise known as data modeling. Examples of an object can range from physical entities, such as a human being who is described by properties like name and address, to small computer programs, such as widgets. Once an object is known, it is labeled with a class of objects that defines the kind of data it contains and any logic sequences that can manipulate it. Each distinct logic sequence is known as a method. Objects can communicate with well-defined interfaces called messages. 3.1 Characteristics of object-oriented programming:  Object-Oriented Development (OOD)  Encapsulation  Abstraction  Classes and Objects  Inheritance and Composition  Binding  Message Passing 3.1.1 Advantages and disadvantages:  Advantages: a. Highly productive software development: OOP is a modular type of programming, which means that it distinguishes between different duties and allows objects to be extended. In other words, objects can be given fresh attributes and become reusable. b. Easier software maintenance: Other programming systems require major structural changes in case of updates or new features. On the other side, OOP makes it possible to focus on individual modules only and simplify software maintenance.  c. Speedy development: Entire libraries of OOP objects are already available for wider usage, so it’s easy to create and develop codes just by using the existing solution. d. Low-cost development: Speed is not the only benefit of object reuse. Namely, developer units can save time and money by reusing and enhancing the existing objects.  e. Improve quality through detailed testing: Programmers who save time with reused objects can dedicate more time to testing and quality assurance. This means that the final product is almost always high-quality and bug-proof.  Disadvantages: a. Programming complexity: A lot of programmers avoid OOP simply because it’s so convoluted. Experienced developers take it for granted, but the fact remains that beginner-level programmers don’t think OOP is user-friendly and easy to handle.  b. Large programs: A typical OOP-based system contains a lot more lines of code than software built with other programming methodologies. Procedural programs are simpler and more attractive for most developers.  c. Slow-running programs: Compared to procedural programs, OOP systems are much slower. That’s because more often than not OOP systems demand a whole range of instructions to be launched and executed.  d. It’s not an all-around solution: 2. You can add more tenants by clicking the add button. If you want to correct it because you wrote it wrong, you can click the edit button. If you want to delete, you can click the delete button. 3. When you want to exit the application, press the exit button. In the above code I have taken the data from the textbox and put it into the DataGridView.