xsharp.eu • Auto-Implement Interfaces - Page 2
Page 2 of 2

Auto-Implement Interfaces

Posted: Mon Nov 21, 2016 9:05 am
by Frank Maraite
Wolfgang,

All those modifiers are there to document the intents of the design to the reader of the code and to let the compiler enforce these. So the subject of personal preference can only be: do I prefer clear design or do I prefer sloppy design. I prefer clear design.

BTW: Did you ever think about combining INTERFACE with ABSTRACT? This let's you create a base class that is incomplete and cannot be used directly, but still offers to implement a completly different inheritance chain.

just my 2ct's
Frank

Auto-Implement Interfaces

Posted: Mon Nov 21, 2016 9:26 am
by wriedmann
Hi Frank,
All those modifiers are there to document the intents of the design to the reader of the code and to let the compiler enforce these. So the subject of personal preference can only be: do I prefer clear design or do I prefer sloppy design. I prefer clear design.
I prefer to have documented the "virtual" on the method name, otherwise I could add it in the compiler options.
I don't think that the use of virtual or not is defining if design is clear or sloppy. I have clear ideas how my application design should be, but of course these ideas are very different from yours as I have a different thinking. And in programming there is not only one truth, but a lot of different styles, some more sloppy, some more clear, but not everyone suited to every programmer or application type.
So I prefer the use of dynamic objects to the generation or the writing of a LOT of code when it comes to models - and I'm sure that many people will not agree here. But I don't see any sense to write hundreds of properties for every possible model class - having to change them every time something in the table structure changes.
BTW: Did you ever think about combining INTERFACE with ABSTRACT? This let's you create a base class that is incomplete and cannot be used directly, but still offers to implement a completly different inheritance chain.
yes, of course. This makes sense, but is work in progress.

Wolfgang