c# - .net TypeConverters and domain usage -



c# - .net TypeConverters and domain usage -

in general, there reason not utilize typeconverter conversion chores involving custom types have nil ui?

im thinking cases more complex implict & explicit conversions.

any links design guidelines & samples doing so?

cheers, berryl

update

here motivation conversion, party - partyrelationship pattern party can have 1 or many partynames. when party person, 1 required name personname.

the personname has attributes different partyname , valueobject. used ui / formatting type tasks whereas partyname entity , persisted database.

so conversions needed: - load db presentation: (partyname --> personname) - add together new contact db: (personname --> partyname)

here's good link explains difference between typeconverter , implementing iconvertible. but, basically, typeconverter built for, , useful for, doing type conversions @ design time. example, it's how xaml converts types xml , back.

iconvertible more flexible, faster (it doesn't utilize reflection), , easier implement typeconverter. unless need features typeconverter gives (like list of standard values), recommend go interface alternative , utilize convert static methods.

c# design domain-driven-design

Comments

Popular posts from this blog

iphone - Dismissing a UIAlertView -

c# - Can ProtoBuf-Net deserialize to a flat class? -

javascript - Change element in each JQuery tab to dynamically generated colors -