Summary We have barely scratched the surface, both in terms of Java as well as OO.

8
Summary We have barely scratched the surface, both in terms of Java as well as OO

Transcript of Summary We have barely scratched the surface, both in terms of Java as well as OO.

Page 1: Summary We have barely scratched the surface, both in terms of Java as well as OO.

Summary

We have barely scratched the surface, both in terms of Java as well as OO

Page 2: Summary We have barely scratched the surface, both in terms of Java as well as OO.

Java

• Not covered:– C.21: applets– C.22: network programming ( 312 next year)

• Java 2:– Improved Collection class stuff– Swing in addition to AWT– Better graphics: Java2D, Java3D– Internationalization– Java beans– JNI: java native interface– Sound– JDBC: connect to SQL databases– RMI: remote method invocation– Servlets

Page 3: Summary We have barely scratched the surface, both in terms of Java as well as OO.

Java development• Java 1.3:

– Lots of improvement to libraries– (HotSpot)– Reflection– Corba– Applet caching/jar indexing

• Java 1.4:– NIO: New IO API– XML– Better Swing performance– Assertion facility– AWT: full-screen mode, headless support, better focus architecture

• Java 1.5: – Generics (templates)– …

Page 4: Summary We have barely scratched the surface, both in terms of Java as well as OO.

Object-oriented concepts

• Multiple inheritance– Not just interface, but also implementation (=

code)– Need “conflict resolution”

• Inherit same names (fields or methods) along multiple pathes

• C++: user must specify explicitly• Dylan, Common Lisp: automatic, use a class-

precedence list

Page 5: Summary We have barely scratched the surface, both in terms of Java as well as OO.

Prototypes

• No distinction between Class and Instance

• Every instance can be used as the Prototype (“class”) for other instances, use socalled delegation instead of methods

• Usually rather dynamic

• SELF system (was also important milestone for JIT research)

• NewtonOS

Page 6: Summary We have barely scratched the surface, both in terms of Java as well as OO.

Generic functions (Dylan, CL)

• All parameters influence method selection (cf. parametric overloading: 2step process)

• Generic functions: all arguments’ runtime types influence choice (theoretically slower)

• Not directly attached to a single class:defeats(Object a, Object b) { return false;}

defeats(Paper a, Rock b) {return true;}

defeats(Rock a, Scissors b) {return true;}

defeats(Scissors a, Paper b) {return true;}

Page 7: Summary We have barely scratched the surface, both in terms of Java as well as OO.

Predicate dispatch

Predicate dispatch

Multiple dispatch

Single dispatch

Cecil,…

Dylan, CL,…

Java, C++,Smalltalk, Delphi,…

public int f(A x, B y) when x.df1() instanceOf C or not(y instanceOf D) { …}

Page 8: Summary We have barely scratched the surface, both in terms of Java as well as OO.

• Keep (having fun) – learning about Java (and possibly other programming

languages)– practising by writing more and more complex

programs

• How: – 3rd/4th year papers– Books (library)– Internet (WWW, newsgroups, mailing-lists)