Presentation is loading. Please wait.

Presentation is loading. Please wait.

Learning objectives By the end of this lecture you should be able to:  have a well-earned rest! Ch 24 Beyond the second semester.

Similar presentations


Presentation on theme: "Learning objectives By the end of this lecture you should be able to:  have a well-earned rest! Ch 24 Beyond the second semester."— Presentation transcript:

1 Learning objectives By the end of this lecture you should be able to:  have a well-earned rest! Ch 24 Beyond the second semester

2 Rapid Application Development (RAD) The RAD approach to program development involves sophisticated development tools for automating or simplifying tasks that would otherwise have to be coded by the programmer. This greatly speeds up development time and so increases productivity. In particular RAD programming tools help significantly in the production of graphical user interfaces.

3 The PushMe application revisited After pushing the button Before pushing the button

4 A typical RAD environment Graphical components, such as AWT Buttons and Labels are selected from a palette Here, an AWT Frame has been selected Here the Design view is selected so the actual appearance of the Frame can be seen. Clicking the Source view shows us the Java code that has been generated. The look and behaviour of the graphical component selected can be changed from this list.

5 Building the GUI Rather than hard coding the selection and appearance of GUI components, the RAD tool allows you to pick them from a palette: The appearance of these GUI components on the Frame does not match exactly the appearance we are after so we can customise them.

6 Customising the GUI Each component’s look can be modified by changing its properties in the properties list. For example, to change the text on the Label to “Enter some text and push the button” select the Label ’s text property The Label’s text property is selected Then the Label’s text property is modified

7 Attaching code to the GUI In order for the GUI application to respond to events we still need to write the code for the event handler. If we double click the Button in design view, the RAD tool will automatically assign an actionListener to this button and take us to that part of the generated code that needs completing. void button1_actionPerformed(ActionEvent e) { // code to be complrted goes here } This code will be the same as that developed before.

8 Java Beans A Java Bean is a more abstract and powerful concept than a simple Java class. A Java Bean is a self contained object that can be used and tested independently of any environment restrictions. A stand-alone visual object is often called a component. Java's AWT and Swing components (which can be found on component palettes of RAD tools) are examples of Java beans.

9 Writing your own Java beans When you write your own Java bean it can be added to a RAD tools component palette. To make a class into a Java Bean it must meets a set of Java Bean rules which These include ensuring the class is declared public and following strict naming rules for get and set methods for private attributes.

10 Java Database Connectivity A common model upon which these database applications are based is the relational database model. Data in such a database consists of a collection of tables. SQL (Structured Query Language) is a common language used to retrieve and modify information within tables. Java’s JDBC (Java DataBase Connectivity) API provides a set of classes for communicating with such databases with SQL statements. These classes are found in the java.sql package.

11 The java.sql package The four main classes in this package are:  DriverManager : loads and sets up the software required to communicate with an external database.  Connection : authenticates and connects the Java program to a database.  PreparedStatement : sends SQL statements to the database for execution.  ResultSet : allows the results of SQL statements to be analysed in the Java program.

12 Networking The java.rmi and java.net packages provide extensive support for networking and distributed systems development. These packages include classes for simplifying the communication between objects spread over a network and include classes such as Socket, and ServerSocket.


Download ppt "Learning objectives By the end of this lecture you should be able to:  have a well-earned rest! Ch 24 Beyond the second semester."

Similar presentations


Ads by Google