Show TOC

Background documentationMixing REL and RS Code in a Library Locate this document in the navigation structure

 

You should not mix code for REL and code with constructors in any one class, as this can have side-effects. You encounter the issue when constructors that take arguments are used.

Example

The following examples illustrate what should and should not be done:

The following class can be used with REL.

public class MyClass

{

public String myFunction(String argument)

{

// Code

}

}

The following class can be used with REL.

public class MyClass

{

private int someVariable;

public MyClass()

{

someVariable = 0; // Default value

}

public MyClass(int newValue)

{

someVariable = newValue;

}

public String myFunction(String argument)

{

// Code

}

}

The following example will have side-effects

public class MyClass

{

private int someVariable;

public MyClass(int newValue)

{

someVariable = newValue;

}

public String myFunction(String argument)

{

// Code

}

}