Programmiermethoden - Einführung

Wenn Programme entwickelt werden, um reale Probleme wie Bestandsverwaltung, Lohn- und Gehaltsabrechnung, Zulassung von Studenten, Verarbeitung von Prüfungsergebnissen usw. zu lösen, sind sie in der Regel sehr umfangreich und komplex. Der Ansatz zur Analyse derart komplexer Probleme, zur Planung der Softwareentwicklung und zur Steuerung des Entwicklungsprozesses wird genanntprogramming methodology.

Arten von Programmiermethoden

Es gibt viele Arten von Programmiermethoden, die unter Softwareentwicklern vorherrschen -

Verfahrensprogrammierung

Das Problem ist in Prozeduren oder Codeblöcke unterteilt, die jeweils eine Aufgabe ausführen. Alle Verfahren zusammen bilden das gesamte Programm. Es ist nur für kleine Programme mit geringer Komplexität geeignet.

Example − For a calculator program that does addition, subtraction, multiplication, division, square root and comparison, each of these operations can be developed as separate procedures. In the main program each procedure would be invoked on the basis of user’s choice.

Object-oriented Programming

Here the solution revolves around entities or objects that are part of problem. The solution deals with how to store data related to the entities, how the entities behave and how they interact with each other to give a cohesive solution.

Example − If we have to develop a payroll management system, we will have entities like employees, salary structure, leave rules, etc. around which the solution must be built.

Functional Programming

Here the problem, or the desired solution, is broken down into functional units. Each unit performs its own task and is self-sufficient. These units are then stitched together to form the complete solution.

Example − A payroll processing can have functional units like employee data maintenance, basic salary calculation, gross salary calculation, leave processing, loan repayment processing, etc.

Logical Programming

Here the problem is broken down into logical units rather than functional units. Example: In a school management system, users have very defined roles like class teacher, subject teacher, lab assistant, coordinator, academic in-charge, etc. So the software can be divided into units depending on user roles. Each user can have different interface, permissions, etc.

Software developers may choose one or a combination of more than one of these methodologies to develop a software. Note that in each of the methodologies discussed, problem has to be broken down into smaller units. To do this, developers use any of the following two approaches −

  • Top-down approach
  • Bottom-up approach

Top-down or Modular Approach

The problem is broken down into smaller units, which may be further broken down into even smaller units. Each unit is called a module. Each module is a self-sufficient unit that has everything necessary to perform its task.

The following illustration shows an example of how you can follow modular approach to create different modules while developing a payroll processing program.

Bottom-up Approach

In bottom-up approach, system design starts with the lowest level of components, which are then interconnected to get higher level components. This process continues till a hierarchy of all system components is generated. However, in real-life scenario it is very difficult to know all lowest level components at the outset. So bottoms up approach is used only for very simple problems.

Let us look at the components of a calculator program.