Chat Tutorial in NetBeans: Difference between revisions

Jump to navigation Jump to search
Content deleted Content added
imported>SimonSmall
The Chat Tutorial: added explanation link to Text Client
imported>Blacklads
Undo revision by Arexrecol, adding further introduction
 
(42 intermediate revisions by 5 users not shown)
Line 7: Line 7:
These instructions assume that you will install the minimum required to use the Marauroa engine. Additional features and functions are covered in separate pages.
These instructions assume that you will install the minimum required to use the Marauroa engine. Additional features and functions are covered in separate pages.


These instructions have been checked using Windows XP, Java SE Development Kit 7 update 2 and NetBeans 7.0.1 and may not be complete (January 2012). Please discuss in the Discussion pages.
These instructions have been checked using Windows XP, Java SE Development Kit 7 update 2 and NetBeans 7.0.1 with Marauroa 3.9 (April 2012). Please discuss in the Discussion pages.


= The Chat Tutorial =
= The Chat Tutorial =
Line 14: Line 14:


This tutorial will create a simple Chat utility based on the Marauroa engine. Users will be able to register, then login to the Chat Client. Text entered into the client is passed to the Chat Server and echoed to all users that are currently logged in. The development is done in stages, where each stage can be verified. The full functionality will not be complete until the completion of the last stage.
This tutorial will create a simple Chat utility based on the Marauroa engine. Users will be able to register, then login to the Chat Client. Text entered into the client is passed to the Chat Server and echoed to all users that are currently logged in. The development is done in stages, where each stage can be verified. The full functionality will not be complete until the completion of the last stage.

== Comments and Javadoc ==

If you do document your design, there is a chance that it will become detached from the code, or may not be updated when the code is changed. This can be avoided by carefully adding comments to the code. These would reflect the design, so that could be discarded, and comments would be changed when code is changed.

There are three types of comment in Java. You should consider using the appropriate type at relevant places in your code so that others (and even you, after a while away from the code) can understand what your code is doing. Make sure that you comment on why the code is there, not what it is doing if that just repeats the code.

* A single line comment, which can start on a line of code and runs to the end of the line, is started using '''//''' (double slash plus space). The double slash and the rest of that line is ignored.

* A block of comment, first line starts '''/*''' (slash, star plus space) and last line ends '''*/''' (space, star plus slash). The block including the first and last lines are ignored.

* A block of Javadoc (code documentation), first line starts '''/**''' (slash, double star plus space) and last line ends '''*/''' (space, star plus slash). The block including the first and last lines are ignored. All the code for a project can be examined, using a process in NetBeans, and a page per class file is produced that contains the Javadoc and explains the code without the reader having to read through the code. These are available for the Marauroa classes.


== Requirements ==
== Requirements ==
Line 20: Line 32:


The Marauroa engine is written using Java. You will need to install the Java Development Kit (JDK) from
The Marauroa engine is written using Java. You will need to install the Java Development Kit (JDK) from
[http://www.oracle.com/technetwork/java/javase/downloads/index.html].
[http://www.oracle.com/technetwork/java/javase/downloads/index.html Oracle/Java].


=== NetBeans ===
=== NetBeans ===


NetBeans is downloaded from [http://netbeans.org/index.html]. It can be extended by installing a large number of plugins; if you are not sure, just use the default installation.
NetBeans is downloaded from [http://netbeans.org/index.html netbeans.org]. It can be extended by installing a large number of plugins; if you are not sure, just use the default installation.


== Directory structures ==
== Directory structures ==
Line 38: Line 50:
== The Chat Tutorial steps ==
== The Chat Tutorial steps ==


The following steps are required to complete the Chat Tutorial.
The following steps are required to complete the Chat Tutorial. Read the pages for each target before trying the code.


Optional preliminary target:
* Build the [[Marauroa on NetBeans|marauroa engine]] code in NetBeans,
* Build the [[Marauroa on NetBeans|marauroa engine]] code in NetBeans,

* Create the files required for the [[Chat Tutorial in NetBeans/Server|Server]],
First Chat target:
* Create the files required for the [[Chat Tutorial in NetBeans/Text Client|Text Client]],
* Create the files required for the [[Chat Tutorial in NetBeans/Text Client|Text Client]],
* [[Chat Tutorial in NetBeans/Deploy Text Client|Deploy Text Client]] code and test it. Check the [[Chat Tutorial in NetBeans/Text Client explanation|Text Client explanation]].
* Create the files required for the [[Chat Tutorial in NetBeans/Server|Server]],
* [[Chat Tutorial in NetBeans/Deploy Text Client|Deploy Text Client]] code and test it. Check the [[Chat Tutorial in NetBeans/Text Client explanation|Text Client explanation]],

Second Chat target:
* Create the files required for the [[Chat Tutorial in NetBeans/GUI Client|GUI Client]],
* Create the files required for the [[Chat Tutorial in NetBeans/GUI Client|GUI Client]],
* [[Chat Tutorial in NetBeans/Deploy GUI Client|Deploy GUI Client]] code, test it and play with it.
* [[Chat Tutorial in NetBeans/Deploy GUI Client|Deploy GUI Client]] code, test it and play with it,
* [[Chat Tutorial in NetBeans/Completion|Create a web deployment]] to complete the tutorial.

If this is now working as expected, it can be extended (see other tutorial projects).


[[Category:NetBeans]]
If this is now working as expected, it can be extended.