TOC PREV NEXT INDEX


Public Member Variables



The next section of the file would be public member variables. In our example above, no member variables are present. This is because INTEGER is a primitive type, so the member variable in which the integer value is stored can be found in the Asn1Integer base class from which this class is derived. This is true for all primitive types - the value will be contained within the run-time base class.

Constructed types will contain public member variables to represent the elements that make up the type. For example, the following SEQUENCE production:


Name ::= [APPLICATION 1] IMPLICIT SEQUENCE {
 
   givenName	IA5String,
 
   initial		IA5String,
 
   familyName	IA5String
 
}
 

will result in the following public member variables being added to the generated class:

	public Asn1IA5String givenName;
 
	public Asn1IA5String initial;
 
	public Asn1IA5String familyName;
 

Note that the member variables are public. They were declared this way to make access easier. A trade-off existed between ease-of-use and secure encapsulation. The ease-of-use approach was chosen because it was felt that the repeated use of get/set methods within deeply nested structures would be too clumsy and bulky in most applications. Therefore, the variables were made public to make the encapsulated values easier to set and retrieve. Consistency checks have been added in some methods to make sure values of the correct types are specified for these elements. These checks are discussed in the sections on the specific constructed types.


Objective Systems, Inc.

102 Pickering Way, Suite #506
Exton, Pennsylvania 19341
http://www.obj-sys.com
Phone: (484) 875-9841
Toll-free: (877) 307-6855 (US only)
Fax: (484) 875-9830
info@obj-sys.com
TOC PREV NEXT INDEX

Copyright © 1997-2005 Objective Systems,Inc.
All Rights Reserved.


This document may be distributed in any form, electronic
or otherwise, provided that it is distributed in its entirety
and that the copyright and this notice are included.