Home Application Packages Application Packages-1
Application Packages-1 PDF Print E-mail
Written by Administrator   
Wednesday, 06 May 2009 23:31

 

Describing Application Class Structure

 

Import any classes that will be used by a class, including the superclass this class extends

  Import PackageName:Superclassname; 

A class is defined using the Class construct.

   Class Classname [Extends SuperClassname]         [Method_declarations]         [Property_declarations]    [Private         [Method_declaration]         [Instance_decalarion]         [Constant_declaration]]     End-class; 

The first set if declarations are the properties and methods that are part of the public, external interface.

  Property datatype PropertyName [get][set];   Method MethodName ([parameter_list]) 

The private instance variables, constants, and the methods are declared following the keyword Private.

  Private     Instance DataType &InstanceName;     Constant &Constant = {Number | String | True | False | Null }; 

The keyword end-class follows the declarations of properties, methods, instances, and constants.

After the end-class keyword and before get and set definitions or method definitions, decclare any variable and functions that will be used my methods.

Get and set methods corresponds to properties declared with the get and set keywords.

Use a get method definition to execute PeopleCode that will return a value.

  get Propertyname    Return &Value;   end-get 

Use a set method definition to execute PeopleCode that will change a value.

  set PropertyName       end-set; 

Method definitions are similar to function definitions.

  method Methodname    statements;   end-method; 

A special case of a method definition is the constructor.

A constructor has the same name as the class and will always run when the class is instantiated.

A class that does not extends some other class does not need any constructor.

A class that extends another class must have a constructor, and in the constructor, it must initialize its superclass.

 

Last Updated on Wednesday, 06 May 2009 23:47
 
Copyright © 2010 peoplesoftfaq.com. All Rights Reserved.