Is Compression Functionality Limited to a Single Library?

Is Compression Functionality Limited to a Single Library?

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


Jav posted on Tuesday, May 25, 2010

Just dipping my toe into Csla offered compression capability.  Seeing the changes made to WcfSLPortal and Web.Config, both of which point to a certain library, I get the impression that compression will only be applied to classes in a single library. 

Is there some config technique that will allow one to go around that limitation?

RockfordLhotka replied on Tuesday, May 25, 2010

The code you are looking at is an example of creating a custom proxy/host for the data portal. Those files can be placed in their own projects - one for Silverlight, the other for .NET - and reused across all your applications.

They are in the business projects only for simplicity, not because they need to be.

Jav replied on Wednesday, May 26, 2010

Rocky,

I thought I heard you talk about compression in one of your videos, but now I cannot find it.  Do you still remember which video it was?

Jav

RockfordLhotka replied on Wednesday, May 26, 2010

Here is a complete index of all the Silverlight videos (thanks to Russ Blair for this),

http://download.lhotka.net/SLVid01Index.htm

So I think video 4 is what you need.

Jav replied on Thursday, May 27, 2010

Thank you, thank you, thank you Russ Blair.  May you live long and prosper.

Jav

Jav replied on Monday, June 14, 2010

RockfordLhotka

 Those files can be placed in their own projects - one for Silverlight, the other for .NET - and reused across all your applications.

They are in the business projects only for simplicity, not because they need to be.

 

Okay, so I am creating a "Server" side project with CompressedHost.cs and CompressionUtility.cs files; and a "Client" side project with CompressedProxy.cs and a link to the CompressionUtility.cs.  ( I have three "business" projects - they each have a different namespace and assembly.  I suppose I can give them a single namespace and put them all in one assembly - if that is necessary or even preferable (I'm a glutton for punishment :).)

Then I would include these projects in the references on the appropriate side. I already have references to the files in the zipbin.  I still have two questions.

First has to do with the line in App.xaml.cs:
      Csla.DataPortal.ProxyTypeName = typeof(Business.Compression.CompressedProxy<>).AssemblyQualifiedName; 

Here Business.Compression is the namespace, and since I have three of them, how would handle it  (unless I consolidate them in one) - or is there another way.

Second has to do with the name of the Service in Web.Config.  Do I create three different services with four WcfPortal.svc files (with different names, of course).

I seem to be talking myself into a single consolidated namespace and a single assembly - just keep the code files in separate projects.

Jav 

RockfordLhotka replied on Monday, June 14, 2010

Like the .NET data portal, the SL data portal doesn't need to be in the same assembly or namespace as your business code. My examples often put it in the business projects - but that is just to keep things simple.

In a bigger app you would absolutely want to have a client assembly with the compression proxy, and a server assembly with the compression host - and those would be entirely separate from your business assemblies.

In reality, you'll probably have your own client and server projects anyway - to contain things like your custom base classes, rule libraries and that sort of framework-related stuff. That's a good place to put the proxy and host code.

Jav replied on Tuesday, June 15, 2010

I got it - and it works. It works even on the server (can you believe it!!!) Wow.  Life is good.

Thanks Rocky

Jav

Copyright (c) Marimer LLC