CSLA day2, detail data binding, errorProvider, SP update

I like this drag-and-drop data binding feature. Detail banding! All the controls with labels can be dragged from Data->Datasource view to form. What developer has to do is just to set the datasource on the form.

If it’s MVP pattern. The presenter should be able to set the datasource object on form directly. I will investigate this later. Right now I just want relax and enjoy this fantastic drag-and-drop for a while.

The next beauty is, by using errorProvider control, all the textboxs can link to the validation rule in BO! With that nice exclamation mark blinking! This is even better than PFC!

For update, I hate wrapping thousands of parameters, then I tried CSLA 3.5 hoping LInQ feature can save me out. But, the SP parm warpper in LinQ to SQL GUI design is not used by CSLA. LinQ is System.Data.Linq.Table, different than CSLA’s base BO.

Can I do partial class to merge those two together? Or how can I take advantage of LinQ to Sql’s custom behavior design?

One problem I encountered is original value in SP. LinQ to Sql can handle this easily, but CSLA’s BO doesn’t have ‘Original’ storage. I had to add a cloned object in retrieve which is used later by update. But, what if user update without read first? When should I take snapshot of all the original values? Right before update?

The update process is very different in CSLA, I start missing NHibernate and pure LinQ to SQL.

What’s next?

– DeepData using LinQ: I really don’t like this mix-ActiveRecord pattern. It also makes mock/test data access impossible.

– After fetch, do we have to do property loop to set each one from fetch result to BO? The problem back to different object in CSLA BO and LinQ. How about define a internal dataobject inside BO, then just pass the fetched data result into this? Obvious, by doing this, all the fields will be one level deeper.


Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s