Download 00085012883e6afa2500e2184a3edfd1d3ded648

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts
no text concepts found
Transcript
Programming paradigms
Unstructured: - This style of programming helps us to
write small and simple programs. In this programming no
separate procedure were written for repetitive task.
Generally we avoid such type of programming.
Structured:- This style of programming helps us to broken
down a large program onto small independent tasks that
are easy to understand without having to understand the
whole program. These tasks are developed independently,
without the help of other tasks.
Object-oriented Programming: - ??

Programming paradigm refers to how a
program is written in order to solve a
problem.
1.
2.
3.
4.
Imperative paradigm
Functional paradigm
Logic paradigm
Object-Oriented paradigm
First do this and next do that

Characteristics:
◦ Straightforward abstractions of the way a traditional Von
Neumann computer works
◦ Execution of computational steps in an order governed
by control structures
◦ Similar to descriptions of everyday routines, such as
food recipes and car repair
◦ Typical commands offered by imperative languages
 Assignment, IO, procedure calls
◦ Language representatives
 Fortran, Algol, Pascal, Basic, C
 "Procedural programming"
Evaluate an expression and use the resulting value
for something
 Characteristics:
◦ Discipline and idea
 Mathematics and the theory of functions
◦ Atemporal
 Time only plays a minor role compared to the imperative
paradigm
◦ Applicative
 All computations are done by applying (calling) functions
◦ The natural abstraction is the function
◦ Fits well with computations driven by needs
Answer a question via search for a solution
 Characteristics:
◦ Discipline and idea
 Automatic proofs within artificial intelligence
◦ Based on axioms, inference rules, and queries.
◦ Program execution becomes a systematic search in
a set of facts, making use of a set of inference rules
Send messages between objects to simulate the
temporal evolution of a set of real world
phenomena
 Characteristics:
◦ Data as well as operations are encapsulated in objects
◦ Information hiding is used to protect internal properties
of an object
◦ Objects interact by means of message passing
◦ In most object-oriented languages objects are grouped
in classes
◦ Classes are organized in inheritance hierarchies



Programmers define not only the data type of a
data structure, but also the types of operations
that can be applied to the data structure.
Data structure becomes an object that includes
both data and functions.
Enable programmers to create modules that do
not need to be changed when a new type of
object is added.








Encapsulation
Data abstraction
Inheritance
Polymorphism
Message passing
Extensibility
Genericity
Inheritance






Object
Encapsulation
Class
Inheritance
Interface
Package

models the real-world objects that you find in
everyday life.
A software object.

Consider a bicycle, for example:
A bicycle modeled as a software object.

Hiding internal state and requiring all
interaction to be performed through an
object's methods is known as data
encapsulation.




Modularity: The source code for an object can be
written and maintained independently of the source
code for other objects.
Information-hiding: By interacting only with an
object's methods, the details of its internal
implementation remain hidden from the outside
world.
Code re-use: If an object already exists (perhaps
written by another software developer), you can use
that object in your program.
Pluggability and debugging ease: If a particular object
turns out to be problematic, you can simply remove it
from your application and plug in a different object
as its replacement.

A class is a blueprint or prototype from which
objects are created.

A mechanism for organizing and structuring your
software.
A hierarchy of bicycle classes.