CSLA 2 Question

Posts   
 
    
Devildog74
User
Posts: 719
Joined: 04-Feb-2004
# Posted on: 23-Apr-2006 06:42:03   

So far, I am having pretty good success with combining CSLA 2.0 and LLBLGen. I have a few questions for those of you using CSLA with LLBLGen. Any help would be much appreciated.

Question 1. Do you build prefetch paths, relationship predicate buckets, sorts, filters, etc. into your derived criteria object?

Question 2. Do you interfact with an instance of a DataAccessAdapter in the DataPortal_XYZ method written in the Business Object , OR do you have a manager class that you call into from the DataPortal_XYZ method?

Question 3. How have you implemented concurrency in your business objects using the concurrency model supported in LLBLGen?

Question 4. How do you get transaction context from the CSLA Runtime to the DataAccessAdapter? Cant you just pass the transaction context generated in the CSLA runtime to the DataAccessAdapter?

omar avatar
omar
User
Posts: 569
Joined: 15-Oct-2004
# Posted on: 23-Apr-2006 20:01:30   

Devildog74 wrote:

Question 1. Do you build prefetch paths, relationship predicate buckets, sorts, filters, etc. into your derived criteria object?

Short answer; YES. For the BL classes that manage single entities, the derived criteria class has 3 constructors: - New(primaryKeyFields of entity)

  • New(primaryKeyFields of entity, prefetch)

  • New(entityToSave, childEntitiesToDelete)

For BL classes that manage collection of entity, the derived criteria class has 2 constructors: - New(bucket, numberOfRecordsToReturn, sorter, prefetch)

  • New(bucket, numberOfRecordsToReturn, sorter, pageNumber, pageSize)

Devildog74 wrote:

Question 2. Do you interfact with an instance of a DataAccessAdapter in the DataPortal_XYZ method written in the Business Object , OR do you have a manager class that you call into from the DataPortal_XYZ method?

I don't exactly understand what you mean by this. I only interact with the DataAccessAdapter inside the DataPortal_XYZ method. I have factory class that creates my DataAccessAdapters.

Devildog74 wrote:

Question 3. How have you implemented concurrency in your business objects using the concurrency model supported in LLBLGen?

I use optimistic concurrency using entity's ConcurrencyPredicateFactoryToUse property. The filter factory for this property is created from a private embeded class.

Devildog74 wrote:

Question 4. How do you get transaction context from the CSLA Runtime to the DataAccessAdapter? Cant you just pass the transaction context generated in the CSLA runtime to the DataAccessAdapter?

CSLA2 supports 3 models of transactions; serviced using enterprise services, scoped using .NET2.0's TransactionScope and simple using ADO.NET's transaction. Because LLBL makes using transactions much easier and effecient than directly using them from ADO.NET (specially when using UnitOfWork) I opted not to use CSLA's scoped transaction model. So, if I am not using COM+ transactions I would be calling into CSLA's SimpleDataPortal.

Devildog74
User
Posts: 719
Joined: 04-Feb-2004
# Posted on: 24-Apr-2006 03:24:13   

Thanks for the reply. I have pretty much implemented things the same way that you have, so I suppose that I am on a decent path.

Cheers

Devildog74
User
Posts: 719
Joined: 04-Feb-2004
# Posted on: 26-Apr-2006 04:51:49   

On another note, I thought I read that the WebServicesProxy doesnt send data as XML, it serializes the data using binary format, then passes the base 64 data in the soap body.

Have you implemented this using LLBLGen? I know that LLBLGen objects are serailizable using binary format, but I havent passed base 64 via web services yet. I was wondering what your thoughts are on this topic.

omar avatar
omar
User
Posts: 569
Joined: 15-Oct-2004
# Posted on: 26-Apr-2006 11:32:39   

Devildog74 wrote:

On another note, I thought I read that the WebServicesProxy doesnt send data as XML, it serializes the data using binary format, then passes the base 64 data in the soap body.

Have you implemented this using LLBLGen? I know that LLBLGen objects are serailizable using binary format, but I havent passed base 64 via web services yet. I was wondering what your thoughts are on this topic.

I am sorry, but all my implementations using LLBL were in a Remoting based distributed environment. Althoug, a project is coming up that I will likely require webservices so not to upset our firewall. It will be very interesting to try your senraiodisappointed

Devildog74
User
Posts: 719
Joined: 04-Feb-2004
# Posted on: 27-Apr-2006 02:51:36   

Uh, its not my scenario. Its what Rockford L has described in this WebServicePortal channel.

I was just wondering if you had implemented it. Do let me know how it works out.