Creating a .net API advice?

Yes you are right. In reality creating 3 abstract subclasses is not good. I agree. At least if those subclasses follow no purpose. Instead creating only a Vehicle-Baseclass would be enough. All concrete cars classes should be divided by the Namespace (and a folder structure) only. I was somehow only referring to Ivelins example. Minor differences can always be grouped by Interfaces. Keeping it simple probably is the rule Nr.1

Thanks @TomTom,

Your explanations are great.

All that leads to the next question in this post:

Is there some best practice or addopted way to organize the folders/namespaces in the project?

Is RhinoCommonā€™s organization standard? Since I am familiar with it.

Doesnā€™t keeping it simple mean more smaller classes or abstract classes?

Thanks @jeremy5,

This is another thing I was wondering. So attributes have their own class. I assume except for these so called ā€œfieldsā€ which donā€™t have the curly brackets with getter and setter functions?

Another question that was roaming in my head. Can I create a class.cs file that contains no class but just methods? Does that make sense in csharp?

Sorry, Iā€™ve forgotten just about everything I ever knew about C#, Iā€™ll have to leave it to someone better qualified to answer questions on itā€¦

A good source for answers to these kind of questions is in the source. Reading code by others who appear to know what they are doing always provides some inspiration. Check out how this project is structured https://github.com/hypar-io/Elements

1 Like