Tag Info

New answers tagged

1

Generic answer: My gut feeling says if you have 30 different but very similar things, you should go one metalevel up, have one class for all of them and push the difference completely down to the data. Even if you end up with a nano VM / nano interpreter. Maybe during implementing it, you find out you really only have two or three kinds of them, ...


0

I would recommend putting the serialization and deserialization code in separate classes rather than the data model classes like it sounds like you are thinking. I'm solving a similar problem now and I have three distinct groups of classes. The first is the model for the messages that contain the various message fields. There's no validation or logic in ...


4

Sounds like you can cover this using straight-forward inheritance. Create a base class with the common implementation, and create subclasses that override that implementation with their own, unique behaviour. You can read up on MSDN here. EDIT: I figured I should elaborate with an example. Define a base class that implements the default behavior of your ...



Top 50 recent answers are included