120 likes | 271 Views
Lecture 14 Advanced Features of Java. Jaeki Song. Software Development using Components. The ideal situation in application development Run on any platform Work with any operating systems Interface with any language
E N D
Lecture 14Advanced Features of Java Jaeki Song
Software Development using Components • The ideal situation in application development • Run on any platform • Work with any operating systems • Interface with any language • Java has many features that aid in multisystem approach to application development • Java Beans, RMI, COBRA, etc.
Java Beans • Java Bean generally refers to components written to extend the Java language • Components that can add to applet or applications • Many components are visual; others are not • You define Java Bean as a class, which can include data fields or properties, methods, events, and storage
Java Bean • A property is a data field that contains a value • E.g., color, size, position, etc. • A method refers to the actions • Send message between two components • Event transmission • The communication between components is called • Event source • A component that fires an event • Event listener • The components that catches the event
Client/Server Applications • Remote Method Invocation (RMI) • Common Object Request Broker Architecture (COBRA) • Distributed Common Object Model (DCOM) • Java Native Interface (JNI) • Java Servlets
RMI • Allows you to use an object that exists on a different computer • The remote system can even call the methods of the object, just as if the object existed on the local machine • This technique is used extensively in client/server applications • Java.rmi package
CORBA • The basis of CORBA relies on an Object Request Broker (ORB) • The ORB can call methods from objects in any language that has an Interface Design Language (IDL) • Since objects can be remote, a system can create objects from a class defined on another system • With ORB, the programmer does not need to know the actual location of the class declaration or the language used to create the class
DCOM • DCOM is Microsoft’s component architecture • At time you may need to use CORBA to work with a system that uses DCOM • You can connect a DCOM client to communicate with a CORBA server by suing the Microsoft’s DCOM-to-CORBA bridge
JNI • JNI allows Java programs to use methods that were created in another programming language • Advantage • Use existing code (legacy code) regardless of the format in which it exists • Interface with other system also is enhanced
Java Servlets • Provides a way to create interactive Web applications • A servlet is like an applet that runs on the server side and is platform independent
Security • Security includes • The validity of classes • The resource restrictions placed on applet running in a browser, such as access local files and printers • Security in JVM contains a verifier and class loader • The goal is to determine that a hostile complier cannot generate dangerous byte code • The class loader locates all classes used by applet • A verifier tests classes so that only appropriate classes are loaded
Security • The security package in Java allows a program to check a digital signature from a developer • Determines that the program has not been altered and does not contains any viruses or malicious operation • Also, Java API contains a Security Manager class for defining the tasks that an application can perform