Another Address Object PostAnother Address Object Post
Old forum URL: forums.lhotka.net/forums/t/4377.aspx
LStevnesUK posted on Wednesday, February 20, 2008
Hi,
Sorry first post type question!
I have company(business base) containing a child address(business base).
On my Windows form can I have a single bindingsource and bind the controls such as
Company.Address.Addr1 and get everything to work?
I can get the fetch & update to work and even the CurrentItemChanged event to fire but
am struggling getting cancel to work on the address object (no problem on the company).I have tried canceledit on the business object and bindingsource and still can only get it to work with the company object.
Thanks
JonnyBee replied on Thursday, February 21, 2008
You must first understand the concept of business objects vs entity objects. Business objects must be denormalized to work properly within CSLA (and databinding). Having a single child object within a root object is going to cause you a lot of headache and will not work as you may hope/expect.
As an example: ValidationRules must be within the "primary" object as VS WinForm designer will only create one BindingSource and this breaks your design of entity objects.
/jonny
Copyright (c) Marimer LLC