In a computing context it
means ways of programming.
Paradigm means an
example or pattern.
Different languages may
use different paradigms.
Some languages may be designed
to use one or many paradigms.
Low-level languages
First languages
created were these
kinds of languages
One to one
relationship with
machine code
Procedural Languages
Programmer states steps
needed to execute program
Programmers decide the steps and
order that the program needs to
follow
Program divided into blocks of code
called functions and procedures.
Procedures have their own variables
that can not be accessed outside of
them.
Logic of the program
expressed via procedure calls.
Languages include:
Pascal, C, Visual Basic
Object-Orientated
Programmer designs
self-contained objects.
Objects contain both
program routines and
the data being processed.
Program is split into objects which
can be used by other objects to
build a more complex system.
Objects are self-contained and
simple and so are easier to program.
Objects can be reused
and inherited without
having to rewrite code.
Languages include: C++,
Delphi, Java, Visual Basic
Object has three main
sections
1: Name: The name of the class
2: Data: Information that all objects of this type
have (all students go to school, so school would
be a data field inside of the class student).
3: Methods: Bits of code that
allow you to access and modify
the data inside of the object.
Data inside of an object can only be
accessed by using the methods provided
inside of the object. This is referred to as
data encapsulation. Data encapsulation
makes it more difficult to write faulty code
that overwrites data incorrectly.
Inheritance
One class can inherit the properties of
another class. The employee class may
inherit the person class, meaning employee
objects does not have to rewrite code that
deals with the name or age of a person.
If X is a class that is inherited by another
class then it is referred to as a super class.
If X is a class that inherits from
another class then it is referred to as
being derived from the super class.
Unified Modeling Language
UML consists of a set of diagrams which are used to
help plan and design the structure of a program
using OOP.
There are several different diagrams that are
a part of UML. We have to know 7 of these.
Class Diagrams
Name of the class
The facts (variables) that need to be known about
any element belonging to the class and the data
structure that will be used.
The methods in the class that are used to
access the facts (variables) inside of the class.
Object Diagrams
A specific student in the class student is referred
to as an object. An object diagram therefore
shows an individual students attributes
This object diagrams refers to any member of the
student class. It is referred to as an anonymous object
Use Case Diagrams
Use case diagrams show what is going into a system
rather than how they work. The actors have control
over the processes. These are generally more business
oriented diagrams than programming related diagrams
however they can help set the ground work.
State Diagrams
State diagrams show how an object behaves through the
various processes of a system. It starts with the initial
circle to show the initial state. The arrows show the flow
of activity from state to state. State transitions occur
when a trigger occurs (such as the process find facts). The
end of the system is shown by end points (a circle with a
dot in) which are the red dots in the diagram above.
Sequence Diagrams
Sequence diagrams show how different classes
interact with each other. At the top of the diagram are
the classes. The dotted lines below the classes shows
how long a class can be seen to be active, this is
referred to as the lifeline of a class. The long thin
boxes are where the are where the methods of the
class have been activated to do something.
Activity Diagrams
Activity diagrams shows the activities needed to get an object to a
particular state. In the exam the diagram will always have keys and so
you don't have to remember the specifics of what symbols means
what, you just have to be confident you can follow the logic.
Communication Diagrams
Communication diagrams show how classes interact with each
other and the order that they interact with each other and the
methods that they use to call each other.
Declarative
Program consists of
a set of declarations.
Describes what computation should
be performed and not how to do it.
A language with clear
correspondence to
mathematical logic.