Presentation is loading. Please wait.

Presentation is loading. Please wait.

Principles of Object-Oriented Software Development The language DLP.

Similar presentations


Presentation on theme: "Principles of Object-Oriented Software Development The language DLP."— Presentation transcript:

1 Principles of Object-Oriented Software Development The language DLP

2 Introduction Terminology Expressions Control Objects Inheritance Techniques Summary

3 DLP -- introduces logic into object orientation DLP = LP + OO + || Design principles -- support for knowledge-intensive applications objects -- dynamic states processes -- communication by rendezvous distributed backtracking -- exhaustive search

4 Objects -- a labeled set of clauses object name { var variables. constructor clauses method clauses } DLP -- terminology

5 Expressions -- terms constants -- a, "a string", [ ] variables -- X,Y,Z compound -- f(a,X), [ H | T ] Prolog Unification -- bi-directional parameter passing f(X,a) = f(b,Y) results in X = b and Y = a

6 Prolog p(X,Y) :- r(Z), b(X). clauses p(X,Y) :- q(Y), b(X). b(X) :- a(X). b(0). facts a(1). q(2). Query ?- p(X,Y). results in (X = 1,Y = 2) and (X = 0, Y = 2)

7 List processing -- backtracking member(X,[X|_]). member(X,[_|T]) :- member(X,T). append([],L,L). append([ H | T ],L,[ H | R ]):- append(T,L,R). DLP -- control (2)

8 Additional statements v := t - to assign to non-logical variables O = new(c(t)) - to create an active instance of the object c O!m(t) - to call the method m(t) for the object O accept(m1,...,m_n) - to accept method requests DLP

9 Computation model objects -- state + methods processes -- to evaluate goals communication -- backtrackable rendezvous distributed logic DLP -- objects (2)

10 object travel { travel var cities = [amsterdam, paris, london]. travel() :- accept( all ), travel(). reachable(X) :- member(X, cities). add(X) :- append( cities, [X], R), cities := R. } Usage ?- O = new travel(), O!reachable(X), write(X).

11 object agency : travel { agency agency() :- accept( any ), agency(). book(X,Y) :- reachable(X), price(X,Y). price(amsterdam,5).... } DLP -- inheritance

12 Techniques meta programming active intelligent agents logic

13 The language DLP design principles -- logic terminology -- distributed backtracking syntax -- Prolog + additional statements objects -- non-logical instance variables inheritance -- static techniques -- active intelligent agents

14 Idioms and Patterns Introduction Polymorphism Idioms in hush A catalogue of design patterns Event-driven computation Summary Q/A Literature

15 Summary

16 Questions 1.How would you characterize OOP and what, in your opinion, is the motivation underlying the introduction of OOP? 2.Characterize the most important features of OOP. 3.Explain the meaning of the phrase "object orientation reduces the complexity of programming." 4.How would you characterize contracts? Why are contracts important? 5.How is OOP related to programming languages? 6.What classes of languages support OOP features? Explain. 7.What influence is an object-oriented approach said to have on the software life-cycle? What is your own opinion? Discuss the problem of maintenance. 8.How would you characterize software quality? 9.Mention a number of object-oriented programming languages, and give a brief characterization. 10.What do you see as the major challenges for research in object- orientation?

17 Further reading Nowadays there are many books that may serve as a starting point for reading about OO. Dependent on your interest, you may look at [Surviving], which treats issues of OO project management, [Meyer97], which gives an extensive introduction to design by contract and programming in Eiffel, or [Fowler97], which gives a succinct introduction to UML. Alternatively, you may take one of the introductory programming books for Java, from which you will almost certainly learn something about OO as well.


Download ppt "Principles of Object-Oriented Software Development The language DLP."

Similar presentations


Ads by Google