Video summary

BISDI FEB UNPAD - Pemrograman Komputer 2 - B - #13 - 10 Nov 2026

Main summary

Key takeaways

Educational

Summary

The lecture introduces modular programming, object-oriented design, and integration through examples in Python. The instructor emphasizes organizing larger applications into manageable components with clear responsibilities and reliable error handling.

1. Modularity and integration

  • Modularity means dividing a program into smaller components—such as functions, classes, or files—that work together.
  • Keeping related code in separate modules makes projects easier to understand, test, update, and debug. For example, a shop application might separate product management, calculations, and the main program.
  • Python modules can be imported when needed, much like libraries such as math or random.
  • Integration connects components into a working system. A main program can coordinate calls to other modules.
  • Modularity and OOP are related but distinct: procedural or functional code can also be divided into modules. A common OOP organization keeps a class in its own file, with a main program coordinating the classes.

2. OOP: Model objects and assign responsibilities

The instructor contrasts procedural thinking—which organizes code around a sequence of steps—with OOP, which focuses on the objects involved and their responsibilities.

A shop example illustrates this structure:

  • Product: Holds details such as name, price, and stock; can check stock and calculate a price.
  • Customer: Holds customer information, such as name and email.
  • Order: Connects customers to the products they purchase; can add items and calculate a total.

In a database, these might correspond to separate tables. An order can refer to a customer and products through keys; in code, the objects interact with one another.

The design should use only as many classes as the problem needs. Each class should have a focused responsibility. If a class accumulates unrelated duties, it may need to be split.

3. Application layers

The lecture describes a typical separation of concerns:

  • Front end: The user-facing interface, such as a GUI or browser.
  • Middle layer: Business rules and processes, such as handling an order.
  • Back end: Data storage and server-side operations.

A restaurant analogy frames the front end as the customer-facing area, the back end as the kitchen or warehouse, and the middle layer as the process coordinating requests between them.

4. Working with APIs and data

The instructor demonstrates a general API workflow:

  1. Send an HTTP request to a server using a URL and a Python request library.
  2. Check the response. A successful response is commonly indicated by status code 200, while other statuses may signal an error.
  3. Read the returned data, often formatted as JSON.
  4. Convert the JSON into Python objects or a suitable data structure.
  5. Use tools such as pandas to create a DataFrame for analysis—for example, counting products, calculating average prices, or grouping results by category.
  6. Visualize results with a plotting library such as Matplotlib.

The key lesson is to understand the data’s format before processing it, especially when working with APIs, databases, or data-analysis projects.

5. A layered project structure

A more complete example combines an API, OOP, a database, and a user interface. Its components include:

  • An API client to retrieve external product data.
  • Product objects to represent that data in the application.
  • A repository to handle database operations.
  • A service to implement business rules and coordinate operations.
  • A main program or GUI to connect and run the parts.

The repository discussion introduces CRUD: Create, Read, Update, Delete. The instructor also stresses checking whether connections and operations succeeded rather than assuming they did.

A rushed example that puts API calls, database work, and display logic into one function is presented as poor architecture. It has unclear responsibilities, lacks validation and error handling, and is harder to maintain.

6. Inheritance, polymorphism, and payment handling

Payment methods demonstrate OOP inheritance and polymorphism:

  • A general payment class can define shared information, such as an amount and date.
  • Specialized classes can represent cash, bank transfers, e-wallets, or credit cards.
  • Each payment type can implement its own processing logic or fees while using a common method name.

The example fees include no fee for cash, a fixed bank-transfer fee, and percentage-based fees for other methods. The point is that the same operation can behave differently depending on the payment object.

The instructor also emphasizes validation and exception handling. For example, a payment process should check the amount and relevant payment conditions. An API failure should be handled deliberately rather than exposing a raw error or producing an inappropriate response.

7. Keep designs simple and review AI-generated code

A recurring principle is “keep it simple”: do not add complexity before it is needed. The instructor advises students to:

  • Understand the requirements and basic design before asking AI to generate code.
  • Review AI-generated code rather than accepting it blindly.
  • Check whether components have sensible responsibilities and whether the code handles expected failures.
  • Test individual parts before integrating them, then test the integrated system.

The lecture frames logical thinking, debugging, and anticipating failure cases as essential skills, even when AI tools are used.

8. GUI demonstration and testing

An ipywidgets example shows how buttons and input fields can act as a GUI for actions such as adding a product to a local database and retrieving products. The interface, service logic, and database operations should be connected clearly.

The instructor relates reliable communication to network protocols: TCP checks that data reaches the intended destination, while UDP is presented as faster but without the same confirmation. The analogy reinforces that applications should check whether connections and operations succeeded.

9. In-class design examples

  • Fuel-station example: Different fuel types inherit shared properties from a general fuel class. Customers can buy fuel by liters or for a set amount of money, with the calculation depending on the purchase method.
  • Rental allocation example: Vehicles have different passenger capacities, so a system must distribute passengers across available vehicles and show who is assigned to each one.

10. Homework

Create a vehicle-rental allocation system.

  • Model vehicles such as a bus, cars, and motorcycles, with capacities and available quantities.
  • Take the number of passengers as input and allocate them across the available vehicles. The instructor suggests starting with the largest-capacity vehicle, then using smaller vehicles for the remainder.
  • For example, a bus capacity of 20 is mentioned; a group of 33 could be divided among a bus and smaller vehicles, subject to the chosen fleet and capacity assumptions.
  • Required: Use OOP and provide a GUI.
  • Optional enhancement: Enter passenger names and display a passenger list for each vehicle. A search feature could locate a passenger and show their assigned vehicle.

Modularity and a database are discussed as possible additions, but the instructor says the immediate assignment can focus on OOP and the GUI. Further examples and instructions are to be shared through Google Classroom.

Speakers and sources featured

  • Speaker: One instructor, whose name is not stated in the subtitles.
  • Other voices: Students briefly ask questions and thank the instructor; no individual students are identified.
  • Sources, tools, and examples mentioned: Python and Google Colab; Python modules and libraries including requests, pandas, Matplotlib, and ipywidgets; a product API referred to as Fake Store API; JSON; a database and repository pattern; Java as a comparison for packages and exception handling; TCP and UDP as networking analogies; and AI tools including ChatGPT/GPT.

Rate this summary

Your feedback will help improve summaries.

Improve this summary

Reprocess with a stronger model when the summary feels incomplete or inaccurate.

Pro

Translate summary in another language

Pro

Ask questions to this video

Chat for follow-up questions, clarifications, and source-backed answers.

Coming soon

Share this summary

Original video