Advice on integrating CSLA 1.52 and CSLA 2.1

Advice on integrating CSLA 1.52 and CSLA 2.1

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


marklindell posted on Tuesday, October 10, 2006

Greetings,

I have been working on an evolving smart client system that is currently using CSLA 1.52 as well as some integrated legacy VB6 and web technologies. The system is fairly large and my company does not have a business case to go back and rebuild the existing CSLA v1.52 components to CSLA v2.1. The current system is built on top of .NET 2.0 and v1.52 is compiled under 2.0.

I would like to start developing new components using CSLA v2.1 from this point forward and not touch the existing v1.52 components.

I am using a data portal hosted in IIS so it would be feasible to have two version of the data portal configured on the server and have each version of CSLA use its respective data portal. The one issue I see is in setting of the Principle on the current thread. This object will be CSLA version specific and it may require automatically authenticating on each version specific Principle before the use of an object. Does this sound like a viable approach? Does anyone see any issues with it?

Another issue I am aware of is that I will not be able to leverage object reuse between 1.52 and 2.1 in switchable use cases. I don’t see this as being an issue in my scenario.

Any other possible gotchas anyone can think of would be greatly appreciated.

TIA,

Mark Lindell

JoeFallon1 replied on Tuesday, October 10, 2006

My strategy is to have single Principal class (built in 2.1).

This class still has all the properties and code that I wrote in 1.x but uses the 2.1 feature set.

Joe

marklindell replied on Tuesday, October 10, 2006

Are you actually doing this or is this a proposal?  It sounds correct as long as there are no .NET 2.0 to .NET 1.1 issues.

Thanks

JoeFallon1 replied on Tuesday, October 10, 2006

I have it running in a test project right now. Plan to go to production code in a few days/weeks when we put the current version to bed and move to ASP.Net 2.0. Looking forward to that. Lots of work ahead though. Plan to run 1.x and 2.1 side by side. I changed the namespace in 2.1 to Csla2 and re-compiled. Works fine.

Joe

 

Massong replied on Thursday, October 12, 2006

Hi Mark and Joe,

I used CSLA 1.x und 2.0 simultaneous in my smart client application side by side to update my business objects step by step. The first business objects I updated were BusinessPricipal and BusinessIdentity and they worked with my old CSLA 1.x classes very well. These are the steps I did to use CSLA 1.x and 2.0 simultaneous in one application:

* I renamed the namespaces of CSLA 1.x from “CSLA” to “CSLA1”
* I changed the assembly names in the project properties of CSLA 1.x from “CSLA*” to “CSLA1*”

After rebuilding both frameworks there was no overlapping left between them and I was able to reference them both in the same application.

* I simply used “Find and replace in files” to change my Imports-statements to use the new namespaces of the old framework: I just replaced “Imports CSLA” with “Imports CSLA1”.
* We use a Windows Service for Remoting instead of IIS. There I registered to services:

' CSLA 1.0
RemotingConfiguration.RegisterWellKnownServiceType(GetType(CSLA1.Server.DataPortal), "NameForTheOldCslaService", WellKnownObjectMode.SingleCall)

' CSLA 2.0
RemotingConfiguration.RegisterWellKnownServiceType(GetType(Csla.Server.Hosts.RemotingPortal), "DifferentNameForTheNewCslaService", WellKnownObjectMode.SingleCall)

 This should be possible in a Web.config-file too, but I have never tested it.

*  My application config file looked like this:

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
  <appSettings>
    <!-- CSLA 1.0 -->
    <add key="Authentication" value="CSLA" />
    <add key="PortalServer" value="tcp://xyz:12345/NameForTheOldCslaService" />
    <!-- CSLA 2.0 -->
    <add key ="CslaAuthentication" value ="Csla"/>
    <add key ="CslaDataPortalProxy" value ="Csla.DataPortalClient.RemotingProxy, Csla" />
    <add key ="CslaDataPortalUrl" value ="tcp://xyz:12345/DifferentNameForTheNewCslaService" />
  </appSettings>
</configuration>

Copyright (c) Marimer LLC