The Definition Window
When opening or creating new Non Visual or Server Side applications the Application Builder switches the display to show the Method Tree, Method Explorer and Source and Definition Windows. These windows give you a complete visual representation of your Java source file.
Definition Window
The definition window allows developers who are not that familiar with Java to easily define the properties of globals, constructors and methods. The definition window has four different configurations. Based upon what type of object is selected in the Method Tree the appropriate settings will be displayed. The four configurations are as follows:
Class Definition
- Name/Desc - enter the name and description of this class.
- Public/Final/Abstract - choose the attributes of this class. In general most classes you create with JDesignerPro will be declared Public.
- Extends - choose or enter the class that this one is extending. A class extends another one when the new class needs the properties of the extended class but with some additional functionality.
- Implements - choose or enter the class that this one is implementing. A class implements another one when the new one needs to have the properties of the other one but the other class is abstract and therefore cannot be extended. If you need more that one implements class separate them with commas or a space but not both.
- Author - Enter the name of the Author of this class. This is purely informational. The author, version, created and last modified dates are stored in the comment header of the class.
- Version - Enter the version number of this class. This is purely informational.
- Created - Enter the creation date of this class. This is purely informational.
- Last Modified - The last modified date may be entered but it is generated by JDesignerPro when the class file is saved.
Constructor Definition
- Description - enter the description of this constructor. This is provided for your benefit only and has no direct effect on the operation of JDesignerPro.
- Public - choose whether the constructor is public or not.
- Parameter Type - For each of the parameters required by this constructor choose or enter the parameter type. Generally these types would be simple data types such as String. JDesignerPro also provides specific support for the following parameter types when you start a class in the Enterprise Server.
- JDPSubsystemMgr - the handle to the Enterprise Server Subsystem Manager. Both Session and Entity classes use this parameter to allow the class to have easy access to the server for controlling it from within your class.
- JDPJob - the handle the the JDPJob container that your class is running in. This allows your class to do such things as write to the job log.
- Parameter Name - choose the name of this parameter.
- Description - enter a description for this parameter. Providing a simple description will help others to decipher what this constructor does. It will also show up in the Java documentation if the Javadoc program is ever run on this class. The description also goes into the source header making it easier for you to read the source of this constructor.
Global Variable Definition
- Name - enter the name of this global variable.
- Type - choose or enter the type of this global variable. Global variables can be any type. If the type is not part of the core Java classes or not a JDesignerPro datatype then use the full class path for the type. e.g. java.lang.String.
- Description - enter the description of this global variable. Entering a short meaningful description will help you and others later in determining the reason for the existence of this global variable.
- Public/Private/Static/Final/Transient - choose the modifiers of this global variable. In general most global variables will either have nothing selected. If you want this global to be accessible from other classes on the server regardless of how many instances of this class exist then declare the variable to be static.
Method Definition
- Name/Desc - enter the name and description of this method. Entering a short meaningful description will allow you to more easily identify the purpose of this method at a later stage. The method descriptions also show up in the Method Explorer and Source windows.
- Public/Private/Protected/Static/Abstract/Native/Final/Synchronized - choose the modifiers of this method. In general most methods will either be public or private. A public method may be accessed from a class outside of this one whereas a private method may only be called internally. If you want the method to be able to be called from an external class without creating an instance of that class first then declare the method as public and static. In this case the method may be called by simply prefixing it with the class name.
- Return Type - choose or enter the return type of this method. If the type is not part of the core Java classes or not a JDesignerPro datatype then use the full class path for the type. e.g. java.lang.String.
- Description - enter the description of the return type. Entering a short meaningful description will help you and others later in determining the type of value returned by this method.
- Throws - if this method is to throw some type of exception if an error occurs then enter or choose it here. Generally most methods you create will return a value indicating whether they were successful but if you'd like more flexibility you can have it throw an exception. If you need more that one exception thrown separate them with commas or a space but not both.
- Parameter Type - For each of the parameters required by this method choose or enter the parameter type. Generally these types would be simple data types such as String.
- Parameter Name - choose the name of this parameter.
- Description - enter a description for this parameter. Providing a simple description will help others to decipher what this method does. It will also show up in the Java documentation if the Javadoc program is ever run on this class. The description also goes into the source header making it easier for you to read the source of this method.