I don't think I've ever said this before, but this looks like a prime candidate for the Visitor pattern.
the visitor design pattern is a way of separating an algorithm from an object structure on which it operates
In essence, the visitor pattern allows you to define the structure of the objects within the objects themselves (in an accept method), while allowing you to put all of your algorithms in the Visitor class (in a set of visit methods, which can then share code through private methods).
public class StructureVisitor
{
public void visit (StructureHouse structure)
{
// do stuff to house here
}
public void visit (StructureDogHouse structure)
{
// do stuff to dog house here
}
public void visit (StructureSecondHouse structure)
{
// do stuff to second house here
}
}
And then you have some parent class that has an accept method a bit like this:
public void accept (StructureVisitor visitor)
{
this.House.accept(visitor);
this.DogHouse.accept(visitor);
this.SecondHouse.accept(visitor);
}
Each of the above accept methods would simply pass themselves on to the visitor class (unless there was more depth to the structure, obviously).
public void accept (StructureVisitor visitor)
{
visitor.visit(this);
}