Summary We have barely scratched the surface, both in terms of Java as well as OO.
-
Upload
rachel-pierce -
Category
Documents
-
view
213 -
download
1
Transcript of 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
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
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)– …
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
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
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;}
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) { …}
• 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)