Headline

Web programming in Language:Java with Technology:GWT

Characteristics

The present project provides a simple WebApp for companies by making use of the Google Web Toolkit and therefore Technology:Ajax. Via asynchronous communication the server provides functionality for cutting and totaling salaries. The server allows the client to retrieve instances of serializable classes of the company's object model. The client presents the provided functionality and retrieved data via predefined GUI components.

Illustration

The connection to the server is provided by the service of this Technology:GWT-application. The pre-requist of this connection is the client-side invokation of this service:

	private final ServiceAsync service = GWT.create(Service.class);

After this initialization, the specific methods of this service are called by simply invoking those methods on the client. The Feature:Cut-button, for example, creates a cut-request, with two possible results. If it is successfull, the new Feature:Total-value is returned and the specific field is set. If not, nothing happens. The following example shows the action for the company-cut button, which should, if successfull, refresh the text-field salaryInfoValue:

	cutButton.addClickHandler(new ClickHandler() {

		@Override
		public void onClick(ClickEvent event) {
			service.cutCompany(new AsyncCallback<Double>() {

				@Override
				public void onSuccess(Double result) {
					salaryInfoValue.setText("Total salary = " + result
							+ " $");
				}

				@Override
				public void onFailure(Throwable caught) {

				}
			});
		}
	});

On the server side, the method is implemented in the following way:

	@Override
	public Double cutCompany() {
		company.cut();
		return company.total();
	}

Architecture

Client: Client classes are to be found in the client package. See org.softlang.client. There is the GUI and a special Feature:Hierarchical company object model for the client with classes that support closed serialization. See org.softlang.client.company for the latter. This object model holds "shallow" data for the widgets. The entry point for the client is the Gwt.java class. Here we describe the app's client side appearance and functionality.

Server: Server classes are to be found in the server package. See org.softlang.server. We use an object model for Feature:Hierarchical company very much like in project Contribution:java (We use a cloned object model for the sake of a simple build for this GWT project.) The server maintains an index (see class Index.java) between shallow and proper objects. That is, departments and employees are identifiable by their ids (say, names).


The communication between client and server is modeled by the Service interface. See the client package. There is also the asynchronous version of it: ServiceAsync.java. These services allow the client to load and save data and perform scenarios Feature:Total and Feature:Cut.

Usage

The implementation is created with Technology:Eclipse (3.6/Helios) and the Technology:GWT-plugin (Version 2.2). If you want to compile the code, you need these versions to run it safely. You can get them at:

After installation and start, simply open this web application as project into eclipse:

If you want to recompile it, please end the old server-process by terminating the process in the Technology:Eclipse console first.

Metadata


There are no revisions for this page.

User contributions

    This user never has never made submissions.

    User edits

    Syntax for editing wiki

    For you are available next options:

    will make text bold.

    will make text italic.

    will make text underlined.

    will make text striked.

    will allow you to paste code headline into the page.

    will allow you to link into the page.

    will allow you to paste code with syntax highlight into the page. You will need to define used programming language.

    will allow you to paste image into the page.

    is list with bullets.

    is list with numbers.

    will allow your to insert slideshare presentation into the page. You need to copy link to presentation and insert it as parameter in this tag.

    will allow your to insert youtube video into the page. You need to copy link to youtube page with video and insert it as parameter in this tag.

    will allow your to insert code snippets from @worker.

    Syntax for editing wiki

    For you are available next options:

    will make text bold.

    will make text italic.

    will make text underlined.

    will make text striked.

    will allow you to paste code headline into the page.

    will allow you to link into the page.

    will allow you to paste code with syntax highlight into the page. You will need to define used programming language.

    will allow you to paste image into the page.

    is list with bullets.

    is list with numbers.

    will allow your to insert slideshare presentation into the page. You need to copy link to presentation and insert it as parameter in this tag.

    will allow your to insert youtube video into the page. You need to copy link to youtube page with video and insert it as parameter in this tag.

    will allow your to insert code snippets from @worker.