Currently I have some code like this:OntologyGenerator generator = new OntologyGenerator();generator.AddOntologyHeader(Testing);generator.AddClassDeclaration(owlBuilder);generator.AddSubClass(owlBuilder);generator.AddAnnotationAssertions(owlBuilder);where that OwlBuilder param you see being passed has collections of objects like this:public class OwlLBuilder: IOwlLBuilder{       private ICollection<IOwlClass> owlClasses = new Collection<IOwlClass>();       private ICollection<IOwlRelation>  owlRelations = new Collection<IOwlRelation> ();}so for example when I say generator.AddClassDeclaration(owlBuilder); it will be looping through owlClasses collection of that owlBuilder param and do some stuff to it...I feel it is an ugly design. Do you have any other better design suggestions, well with some code sample so I can have the big picture of what I should do in my head!
Whats a better way of designing this class
object oriented design
I have 2 opposing ideas:Get rid of the IOwlBuilder completly and pass collection themselves.OntologyGenerator generator = new OntologyGenerator();generator.AddOntologyHeader(Testing);generator.AddClassDeclaration(classes);generator.AddSubClass(relations); // ??generator.AddAnnotationAssertions(??);Create an interface that will provide all data needed for creation.public interface IOntologySource {     public string GetHeader {get; }     public ICollection<IOwlClass> Classes {get; }     public ICollection<IOwlRelation> Relations {get; }   }And then use it as parameter in constructor.OntologyGenerator generator = new OntologyGenerator(ontologySource);But it seems like you are not telling us everything and there is much more going on with your code. You should add more details if you want better answer.