CSLA and WCF - how would I use business objects without support for the DataContract concept?

CSLA and WCF - how would I use business objects without support for the DataContract concept?

Old forum URL: forums.lhotka.net/forums/t/1645.aspx


slonatejones posted on Tuesday, October 31, 2006

I see that the WCF channel adapter is built, but I'm having a tough time grasping how BOs will be serialized through the channel to a WCF service if there is no support for the DataContract concept yet. Do I have to build some sort of translation layer that tranlates XML (DataTable, perhaps) from the WCF service to the BO layer?

Any help is extremely appreciated.

ajj3085 replied on Tuesday, October 31, 2006

To my knowledge, the WCF channel isn't finished yet, and Rocky is implementing the code necessary for DataContract.  the WCF channel should be available for Csla 3.0

slonatejones replied on Tuesday, October 31, 2006

Thanks for the quick reply. Yes, I understand that it is not yet complete, and that Rocky will roll the channel into CSLA 3.0 (as opposed to the current "drop on") and also build the support for the DataContract.

My problem is that we're already knee-deep in building a CSLA-based product right now and want to throw WCF into the mix -- and can't wait for 2.x or 3.0.

Our product basically aggregates data from N databases using a web front end. We want to build a WCF service to sit on a separate box from the web server to do this aggregation, then return the results to the web server. So, I don't know how BOs can be sent back to the web server through the WCF channel. It seems like the BO is going to have to populate itself *on the web server* from a DataTable returned from the WCF service.

Am I missing something?

slonatejones replied on Tuesday, October 31, 2006

The fact that the channel adapter is already built leads me to believe there is some way to get the business objects to move across. If not, how is the channel able to be tested?

Is there *any* CSLA+WCF example code out there?

slonatejones replied on Tuesday, October 31, 2006

OH...can the channel support CSLA objects because of the "Serializable" attribute? No [DataContract] needed?

ajj3085 replied on Wednesday, November 01, 2006

:
My problem is that we're already knee-deep in building a CSLA-based product right now and want to throw WCF into the mix -- and can't wait for 2.x or 3.0.


You realize that WCF is still beta itself?  Why the rush to add reliance on a beta version?  The channel is there, that doesn't mean its finished.  Check out what Rocky has to say about it.

Anyway, if you want to, you'll probably have to implment this support yourself.  I think Rocky is concentrating on the ebook for 2.1 and the other things he needs to take care of.

The WCF channel is just used to move your object from the client to an application server, which would be your seperate box.  As long as the DP methods can get to the data it needs (i.e., contact the webserver to get the data) it should be fine. 

HTH
Andy

slonatejones replied on Wednesday, November 01, 2006

Yes, all understood. We're really about a year out for our Beta, so we're pretty confident that WCF kinks will be worked out by then. App server is on separate box. Web server hits app server; app server hits N databases, aggregates data, then returns results to web server. I just needed to make sure I can use my CSLA BOs across the board.

Thanks for your info.

ajj3085 replied on Wednesday, November 01, 2006

So you've got some time.

Well, I would just plug along using the remoting proxy.  The way Csla works, it shouldn't matter at all which DP channel you're using... it should 'just work.'  So I wouldn't worry about it now, just build your bos.. test with remoting on.  as long as that works, in theory, WCF should work as well.    But most of your work will be the BOs.  Then when Csla 3 is out, test it out on a real setup. 


Good luck.
andy

Copyright (c) Marimer LLC