You guys come up with some of the best designs I've seen so here goes.
We are implementing a process that I am designing with a state manager. At any time a merchant can be in some state regarding credit processing (Accepted, ReadyForProcessing, Cancelled, SwitchingProcessors, etc).
We are building the business objects with CSLA and that all works well, however we want the GUI programmer to have access to only a single interface called something like ICreditProcessor
The state manager would return the proper (current) state as an ICreditProcessor instance and then raise an event that the GUI hears and appropriately refreshes the binding for values, editability and visibility..
For databinding the only way we have come up with would be for ICreditProcessor to allow things like IsMerchantNameEditable, IsMerchantNameVisible, IsSICCodeEditable, IsSICCodeVisible, etc for everything we'd want to bind to.
We thought about a dictionary<string, bool> where string is the property name and then we databind to something like EditableFieldDictionary["MerchantName"]. But that won't work.
Neither will databinding to a function like
IsPropertyEditable("MerchantName") that in turns searches the dictionary or performs some business logic.
So, how would you guys approach this?
Thanks,
Will
Copyright (c) Marimer LLC