Graduate Program KB

Chapter 3 - Paradigm Overview

Three Paradigms

  • Structured, Object Oriented and Functional programming is briefly described in this chapter. As they will be explored in the next three chapters

Structured Programming

  • "Structured progrmming imposes discipline on direct transfer of control"

  • First paradigm to be adopted

  • Discovered by Dijkstra in 1968

  • The structured programming paradigm denounces the use of goto statements opting for structured control constructs.

    • These include if/else statements, while/for loops.
  • Structured programs adopt this pattern over the use of a goto statement because goto statements:

    • Make the code hard to read and follow for other developers
    • The design of the code is coupled and hard to change from the lack of modularity
    • Difficult to test code that does not follow a clear structure

Object Oriented Programming

  • "Object oriented programming imposes discipline on indirect transfer of control"

  • Adopted in 1966

  • Based on the break down of code into cohesive classes

  • Employs the use of polymorphism and the act of inheriting methods and properties from parent classes.

  • Objects of classes can be used in other classes for communication

Functional Programming

  • "Functional programming imposes discipline on assignment"

  • Immutable data, Data can not be modified after it is created

  • Rather the use of functions that take in some input and return a new value are imposed in this paradigm

Conclusion

  • Each paradigm imposes some restriction on the developer, telling them what they should not do rather than what they should do

  • These three paradigms are core to the concerns of software architecture as they deal with imposing restrictions on function, seperation of concern and data managment

  • No new core paradigms have been discovered. All these were discovered in the 10 years between 1958 and 1968

Other Paradigms

  • Paradigms are generally accepted to be split into:
  • Imperative (How something should be done)
    • Procedural / Structured
    • Object Oriented
    • Parallel
    • Event-Driven
  • Declarative (What should be done)
    • Functional
    • Logic
    • Data Driven