EricF posted on Wednesday, March 21, 2007
I use programming only occassionally to supplement my professional work as a manager in an architectural design firm, so please forgive or ignore parts of my questions that may have more to do with weak skills vs CSLA specifically. I feel more comfortable with aspects of CSLA features (authorization, validation, etc.) than overall usage right now.
Consider a set of classes designed to implement Money as a core business library object, with the focus on Currency to keep this more focused. My first non CSLA attempt at this resulted in a public class named Currency, which contains a nested public struct of currency aspects of interest called CurrencyInfo and a generic SortedList with the ISO currency code as the key and the associated CurrencyInfo struct as the value. The class is instantiated with a constructor that takes either a currency code or CultureInfo code, and the static list is built if necessary. There are convenience constructors for common currencies (ie, USD).
Applying CSLA to this leaves me scratching my head in a few places.
The CurrencyInfo struct can be a read only BO, but what do I gain from this. Data binding?
The Currency class itself should(?) then be implemented as a NameValueListBase I guess. but
(1) what do I gain from this considering the information is not kept
statically but generated from the Net framework itself (why there isn't
such a class in Net as there is in java is a different question), has no authorization or validation concerns?
(2) how do I sort this after its built?
(3) anything in CSLA that aids a singleton class, or is that just irrelevant?
Questions, comments, answers most welcome (Eric is NOT my real name if the answer is read the damn book again, dude
)