I have seen the following code in one of our applications:
public class First()
{
private Second _second;
public First()
{
_second = new Second(this);
// Doing some other initialization stuff,
}
}
public class Second
{
public Second(First f)
{
}
}
In the First() constructor, isn't it bad that we are sending a reference of class First() before it is fully constructed? I am thinking that the object is only fully constructed once the control logic leaves the constructor.
Or is this okay?