Using CSLA 4: Data Access pre-draft available

Using CSLA 4: Data Access pre-draft available

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


RockfordLhotka posted on Friday, January 14, 2011

I just put a very early pre-draft version of the Using CSLA 4: Data Access ebook on the download site. If you own the ebook series you can download this PDF.

This early version has a draft of Chapter 1 - about 25-30 pages - plus the rough outline for Chapters 2 and 3.

Chapter 2 is where I'll really get into the hard-core coding that demonstrates the various data portal models along with some DAL implementation concepts.

Chapter 3 will focus on n-tier data portal configuration.

Lots of great content yet to come, but I wanted to make Chapter 1 available now.

RockfordLhotka replied on Tuesday, January 18, 2011

I uploaded a new pre-draft of the Data Access ebook today (revision 0.2).

I'm up around 45-50 pages of content now. This book is going to be fairly large I think, given that I'm working on chapter 2 of what is now 5 chapters.

(hopefully I'll make up for it with the Security ebook, which should be relatively compact Smile )

rxelizondo replied on Wednesday, January 26, 2011

HI Rocky,

 

Is there a link where I can find the errata for the different books?

I found one or two issues in one of the books and wanted to report them but there is no point on doing that if someone else already did.

Thanks.

RockfordLhotka replied on Wednesday, January 26, 2011

Not currently. Right now all you can do is send email to errata@lhotka.net to report issues.

I'm not entirely sure how to handle errata for these yet. The only book that's out of draft is the first one, but even when I get errata for that one my thought is that I'll fix it and update the PDF.

So there's no point in having a database of errata in the traditional paper book sense, since people can always go get the latest PDF.

And yet you are right, there's some value in having a database of errata for the latest revision to avoid duplication.

But I'm not sure how useful that'd be, since some of the errata I've already received has been against older revisions than current.

In any case, I don't want to take time away from my book writing efforts to build an errata tracking system into my web site...

DennisWelu replied on Wednesday, January 26, 2011

Hi Rocky,

I'm working on a Silverlight app and want to get it working in 4-tier mode, with the web server forwarding the DataPortal calls to an app server behind the firewall. Searching the forums you indicate in several places that the how-to for this is in video 4 of your Silverlight video series, which I've considered acquiring but haven't yet. Now I see your CSLA 4 Data Access book will have a chapter on "n-tier data portal configuration." Will you be covering 4-tier Silverlight? I've already purchased the CSLA 4 ebook series, so if an upcoming chapter will eventually answer my question I can wait.

Or is there an easy, one-line-of-the-web.config answer to the 4-tier question that I'm missing?

Thanks!

RockfordLhotka replied on Wednesday, January 26, 2011

Yes, the Data Access ebook will cover 4-tier configuration.

This has been discussed in the forum before, but finding old threads can be challenging :(

It isn't hard though.

  1. Set up the client to talk to a Silverlight data portal endpoint on your web server
  2. Set up the web server with a Silverlight data portal endpoint
  3. Configure the web server with the .NET data portal proxy and URL to talk to the application server
  4. Set up the app server with a .NET data portal endpoint

The result is that the web server listens for Silverlight clients just like every 3-tier SL example in the Samples download. But the web server also has client-style data portal configuration so the data portal on the web server talks to the app server.

The app server listens for .NET clients just like every 3-tier .NET example in the Samples download. And the app server actually has the data access components installed.

The only interesting bit is that the web server has configuration for the SL data portal endpoint, and data portal client configuration to talk to the app server.

Once you get that working you can also use the MobileFactory attribute to trigger "inspector" or "observer" objects to run on the web server to screen inbound client requests before they are allowed to flow through to the app server. I'll talk about that in the Data Access book too.

DennisWelu replied on Wednesday, January 26, 2011

Perfect, thanks Rocky!

Your explanation triggers another question. though. For my app I'm not concerned about monitoring the objects as they flow through the web server. In fact, to optimize performance I'd love to simply relay the raw data to the app server and have it decompressed and deserialized there (I've implemented compression). However, your steps imply the channel between the servers uses .NET serialization, so I assume the web server would be decompressing and deserializing the silverlight mobile objects, re-serializing them with .NET, and sending them to the app server where they're deserialized again. Is a simple relay possible instead? In fact, I would think a relay wouldn't need any of my server assemblies, nor most of CSLA for that matter.

 

RockfordLhotka replied on Wednesday, January 26, 2011

The current data portal implementation does deserialize and reserialize each request, that's true.

That's generally unavoidable as long as WCF is used, because WCF is what handles the serialization/deserialization of the message data.

You could bypass some of that by implementing a data portal host that passed byte arrays to/from the client - like I did to implement the asmx channel years ago. WCF would still serialize/deserialize the byte array data, but not the actual object information in the byte array(s).

And you really can do this - the data portal is very open - you'd just need to create your own SL proxy/host pair, where the proxy serializes/deserializes objects into byte arrays and where the host (running on the web server) doesn't unpack the byte arrays.

And you'd need to create your own .NET proxy/host pair, where the proxy (running on the web server) just passes the byte arrays back and forth, and where the host (running on the app server) serializes/deserializes the byte arrays into objects and delegates to the standard server-side DataPortal object.

This shouldn't be be overly difficult.

RockfordLhotka replied on Friday, February 04, 2011

I just put a new pre-release of the ebook online for download, along with associated sample code.

The ebook is around half done now. It keeps growing as I write, but I think it is all downhill from here :)

RockfordLhotka replied on Monday, February 21, 2011

I put another pre-release (revision 0.4) of the Data Access ebook online for download, along with updated sample code.

I expect to have at least all the data access aspects of the book done this week.

I don't know if I'll complete all the data portal configuration material this week, but I'm finally getting close to complete on this book.

It is at 124 pages now, and I'm beginning to think it will be around 200 when I'm done.

rxelizondo replied on Wednesday, February 23, 2011

Rocky,

Quick question,

Each time you publish a new release, do you sometimes go back and add pages of new information to areas of the book you have already published? For example, did you go back to say page 5 of the book and inserted 10 pages of new information there? Or are you only appending content?

I am only asking because I read the current existing material (I think you stopped at page 85 or something like that) and I intend to just continue reading from where I left off and I would hate to miss some good stuff if you added the stuff somewhere before you left off.

I guess I can always compare the two documents using Microsoft Word or something but I rather not if I know before hand I don't need to.

 

Thanks.

JCardina replied on Wednesday, February 23, 2011

Looking forward to an example of an editable child object for post .4 versions of the data access book as currently it's only got editable root object persistence which was tremendously helpful but between all the ebooks there's no example of an editable child object only references to it being covered in the data access ebook.

RockfordLhotka replied on Wednesday, February 23, 2011

The 0.4 revision of the Data Access ebook includes discussion of an editable root list, and the editable child objects it contains.

The next revision will include a "complex graph" discussion, with a parent/child/grandchild scenario - but that's mostly a rehash of the editable root list discussion - at least from the perspective of the editable child object.

Copyright (c) Marimer LLC