design using a readonly class in c#
Posted
by edosoft
on Stack Overflow
See other posts from Stack Overflow
or by edosoft
Published on 2010-04-08T09:12:09Z
Indexed on
2010/04/08
9:23 UTC
Read the original article
Hit count: 281
c#
|design-patterns
Hi
Small design question here. I'm trying to develop a calculation app in C#. I have a class, let's call it InputRecord, which holds 100s of fields (multi dimensional arrays) This InputRecordclass will be used in a number of CalculationEngines. Each CalculcationEngine can make changes to a number of fields in the InputRecord. These changes are steps needed for it's calculation.
Now I don't want the local changes made to the InputRecord to be used in other CalculcationEngine's classes.
The first solution that comes to mind is using a struct: these are value types. However I'd like to use inheritance: each CalculationEngine needs a few fields only relevant to that engine: it's has it's own InputRecord, based on BaseInputRecord.
Can anyone point me to a design that will help me accomplish this?
© Stack Overflow or respective owner