Auto-Implement Interfaces

This forum is meant for questions and discussions about the X# language and tools
Frank Maraite
Posts: 178
Joined: Sat Dec 05, 2015 10:44 am
Location: Germany

Auto-Implement Interfaces

Post 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
User avatar
wriedmann
Posts: 3743
Joined: Mon Nov 02, 2015 5:07 pm
Location: Italy

Auto-Implement Interfaces

Post 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
Wolfgang Riedmann
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
Post Reply