SelfServicing and Adapter in the same project?

Posts   
 
    
alexdresko
User
Posts: 336
Joined: 08-Jun-2004
# Posted on: 30-Jun-2006 20:09:27   

Maybe this is crazy, but before I got to this company, they started on a HUGE project with SelfServicing. Now they're starting to reazlie the advantages of the adapter model and have considered making the switch. Unfortunately, there's a LOT of code that uses the SS model already. Is it possible to use both the adapter and selfservicing in the same project without breaking anything?

The idea is to start using Adapter for now and then gradually replace all of the older SS stuff.

Thanks! LLBL FTW!

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39928
Joined: 17-Aug-2003
# Posted on: 01-Jul-2006 08:36:53   

It can be cumbersome, as you can't share entities between the different code. So you can't save a selfservicing entity with adapter and vice versa.

What you could do is generate also adapter code from the same project, and for fixed parts of the application switch over to adapter, while in other code you keep selfservicing. You've to keep in mind that this might give a lot of headaches if you pass entities around a lot.

If you really must, you can always pass around the raw data of an entity as an array of IEntityFieldCore, see entity.Fields.GetAsEntityFieldCoreArray(), which could help perhaps in situations where you need to pass around field data. the objects still are of their native types, so it will work from selfservicing -> adapter to re-instantiate IEntityFields2 objects, but it won't work the other way around (with the constructor which eats an array of IEntityFieldCore) as you then miss persistenceinfo.

Though if I were you, I'd port one part of hte application at a time.

Frans Bouma | Lead developer LLBLGen Pro