I was on the IBM page looking for some filenet example code for .NET and I found this:
namespace CESample
{
// Represents the connection with the Content Engine.
public class CEConnection
{
private IDomain domain;
private IObjectStoreSet ost;
private ArrayList osNames;
private String domainName;
private bool isCredentialsEstablished;
// Constructor
public CEConnection()
{
domain = null;
ost = null;
osNames = new ArrayList();
domainName = null;
isCredentialsEstablished = false;
}
//... other methods
Its this alright, to set always every variable to null while creating an object? And How about the bool and new ArrayList()? Is that how we should do that? Setting boolean always to false?
Everything except the array list is unneeded.
Fields are automatically initialized with their respective default value before the code inside the constructor is executed.
This code is equivalent: