Entities through COM?

Posts   
 
    
Alvaro
User
Posts: 52
Joined: 01-Jun-2004
# Posted on: 01-Nov-2005 21:11:26   

Hello, I'm currently working in a big project with a lot of entites. GenPro has been a big help. Early in the project we decided to use entities as DTO's across tiers, so most of our server operations receive and/or return entities, entity collections, etc. We are using the Adapter model of course.

Now we're selling our system to a client that wishes to use an IVR interface for a lot of operations (say 50+). So they hired a third party contractor to provide all the phone-related code. But their system is built with Visual Studio 6.0 and ours uses C#.NET.

For some reason, it was agreed that we would provide this third party contractor with a COM component to allow them access to our server disappointed

So I need to find a way to offer operations that look like


OneEntity DoSomething(AnotherEntity, bool parameter);

through COM so that they can consume them from Visual Studio 6.0. So how would you go about it? I'm pretty sure I can hand-code a wrapper .dll that references our code and transforms entities to vanilla C# classes that can be exported to COM with tlbexp. But that would be too much repetitive work.

I tried exporting the db generic .dll with tlbexp but I get a lot of System.Data and System.Component - related warnings which I copy at the end. I can import the entity types alright to VB6 but I get errors trying to access their properties.

So... Is it possible at all to expose the generated entities to a COM client? confused Maybe it IS possible and I haven't found the way yet... any help?

If it isn't... do you think it's possible to add a new template that generates a wrapper that translates entities automagically and is exposable through COM?

Any help will be appreciated. Cheers álvaro.-

p.d.: the warnings follow:


Type library exporter warning processing 'SD.LLBLGen.Pro.ORMSupportClasses.IDataAccessAdapter.StartTransaction(isolationLevelToUse), SD.LLBLGen.Pro.ORMSupportClasses.NET11'.  Warning: Non COM visible value type System.Data.IsolationLevel is being referenced either from the type currently being exported or from one of its base types.
Type library exporter warning processing 'SD.LLBLGen.Pro.ORMSupportClasses.IDataAccessAdapter.StartTransaction(name), SD.LLBLGen.Pro.ORMSupportClasses.NET11'.  Warning: Type library exporter encountered an unknown signature element.
Type library exporter warning processing 'SD.LLBLGen.Pro.ORMSupportClasses.IDataAccessAdapter.get_TransactionIsolationLevel(#0), SD.LLBLGen.Pro.ORMSupportClasses.NET11'.  Warning: Non COM visible value type System.Data.IsolationLevel is being referenced either from the type currently being exported or from one of its base types.
Type library exporter warning processing 'SD.LLBLGen.Pro.ORMSupportClasses.IDataAccessAdapter.set_TransactionIsolationLevel(value), SD.LLBLGen.Pro.ORMSupportClasses.NET11'.  Warning: Non COM visible value type System.Data.IsolationLevel is being referenced either from the type currently being exported or from one of its base types.
Type library exporter warning processing 'SD.LLBLGen.Pro.ORMSupportClasses.IEntityCollection.Sort(direction), SD.LLBLGen.Pro.ORMSupportClasses.NET11'.  Warning: Non COM visible value type System.ComponentModel.ListSortDirection is being referenced either from the type currently being exported or from one of its base types.
Type library exporter warning processing 'SD.LLBLGen.Pro.ORMSupportClasses.IEntityCollection.Sort(direction), SD.LLBLGen.Pro.ORMSupportClasses.NET11'.  Warning: Non COM visible value type System.ComponentModel.ListSortDirection is being referenced either from the type currently being exported or from one of its base types.
Type library exporter warning processing 'SD.LLBLGen.Pro.ORMSupportClasses.IEntityCollection.Sort(comparerToUse), SD.LLBLGen.Pro.ORMSupportClasses.NET11'.  Warning: Type library exporter encountered an unknown signature element.
Type library exporter warning processing 'SD.LLBLGen.Pro.ORMSupportClasses.IEntityCollection.Sort(direction), SD.LLBLGen.Pro.ORMSupportClasses.NET11'.  Warning: Non COM visible value type System.ComponentModel.ListSortDirection is being referenced either from the type currently being exported or from one of its base types.
Type library exporter warning processing 'SD.LLBLGen.Pro.ORMSupportClasses.IEntityCollection.Sort(comparerToUse), SD.LLBLGen.Pro.ORMSupportClasses.NET11'.  Warning: Type library exporter encountered an unknown signature element.
Type library exporter warning processing 'SD.LLBLGen.Pro.ORMSupportClasses.IEntityCollection2.Sort(direction), SD.LLBLGen.Pro.ORMSupportClasses.NET11'.  Warning: Non COM visible value type System.ComponentModel.ListSortDirection is being referenced either from the type currently being exported or from one of its base types.
Type library exporter warning processing 'SD.LLBLGen.Pro.ORMSupportClasses.IEntityCollection2.Sort(direction), SD.LLBLGen.Pro.ORMSupportClasses.NET11'.  Warning: Non COM visible value type System.ComponentModel.ListSortDirection is being referenced either from the type currently being exported or from one of its base types.
Type library exporter warning processing 'SD.LLBLGen.Pro.ORMSupportClasses.IEntityCollection2.Sort(comparerToUse), SD.LLBLGen.Pro.ORMSupportClasses.NET11'.  Warning: Type library exporter encountered an unknown signature element.
Type library exporter warning processing 'SD.LLBLGen.Pro.ORMSupportClasses.IEntityCollection2.Sort(direction), SD.LLBLGen.Pro.ORMSupportClasses.NET11'.  Warning: Non COM visible value type System.ComponentModel.ListSortDirection is being referenced either from the type currently being exported or from one of its base types.
Type library exporter warning processing 'SD.LLBLGen.Pro.ORMSupportClasses.IEntityCollection2.Sort(comparerToUse), SD.LLBLGen.Pro.ORMSupportClasses.NET11'.  Warning: Type library exporter encountered an unknown signature element.
Type library exporter warning processing 'SD.LLBLGen.Pro.ORMSupportClasses.ITransaction.get_TransactionIsolationLevel(#0), SD.LLBLGen.Pro.ORMSupportClasses.NET11'.  Warning: Non COM visible value type System.Data.IsolationLevel is being referenced either from the type currently being exported or from one of its base types.
Type library exporter warning processing 'SD.LLBLGen.Pro.ORMSupportClasses.IRetrievalQuery.Execute(behavior), SD.LLBLGen.Pro.ORMSupportClasses.NET11'.  Warning: Non COM visible value type System.Data.CommandBehavior is being referenced either from the type currently being exported or from one of its base types.
Type library exporter warning processing 'SD.LLBLGen.Pro.ORMSupportClasses.IDbSpecificCreator.CreateParameter(direction), SD.LLBLGen.Pro.ORMSupportClasses.NET11'.  Warning: Non COM visible value type System.Data.ParameterDirection is being referenced either from the type currently being exported or from one of its base types.
Type library exporter warning processing 'SD.LLBLGen.Pro.ORMSupportClasses.IDbSpecificCreator.CreateParameter(direction), SD.LLBLGen.Pro.ORMSupportClasses.NET11'.  Warning: Non COM visible value type System.Data.ParameterDirection is being referenced either from the type currently being exported or from one of its base types.
Type library exporter warning processing 'SD.LLBLGen.Pro.ORMSupportClasses.IDbSpecificCreator.CreateParameter(direction), SD.LLBLGen.Pro.ORMSupportClasses.NET11'.  Warning: Non COM visible value type System.Data.ParameterDirection is being referenced either from the type currently being exported or from one of its base types.
Type library exporter warning processing 'SD.LLBLGen.Pro.ORMSupportClasses.IDbSpecificCreator.CreateParameter(value), SD.LLBLGen.Pro.ORMSupportClasses.NET11'.  Warning: Type library exporter encountered an unknown signature element.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39749
Joined: 17-Aug-2003
# Posted on: 02-Nov-2005 19:19:08   

It's hard to say what's the correct way to do things. I once tried to use the entities from a VB6 app, through COM, and it somewhat worked, but it was terribly slow and had a lot of problems, so I gave up on that.

Isn't it better for the 3rd party to write a MC++ wrapper for THEIR code? I think ideally a managed C++ wrapper would be best to bridge the calls back and forth.

Frans Bouma | Lead developer LLBLGen Pro
Alvaro
User
Posts: 52
Joined: 01-Jun-2004
# Posted on: 02-Nov-2005 20:58:04   

Well I'd just LOVE to have them build their own wrapper, although the project was defined as it is and I'm stuck with it.

I'm going to try and develop some sort of half generated - half reflection-generic wrapper, hopefully we won't have to hand code that. It would certainly qualify as most boring task ever rage

salut álvaro.-

sparmar2000 avatar
Posts: 341
Joined: 30-Nov-2003
# Posted on: 03-Nov-2005 12:05:30   

Hi, I worked on a system that has IVR as one of its 'User Interface'.

In my experience, an IVR is very 'chatty' and therefore needs small amout of data to carry out a 'business function'

For example a Business Function 'Bank Balance' would steps such as 1. ValidateUser, 2. ValidatePINno, 3. ValidateAccountNo, 4. GetBalance.

Each step would be initiated after the user has 'typed' in the data on the phone. For example, the IVR would annouce 'Please enter your user code' - the user would tap his code and then press #. At the press of the hash, the system would be required to call ValidateUser(UserCode) which would return a true or false 'most of the time because IVR software if very simple.

If the above assumption is corrent, then you could use XML as your DTO. Your current system would need to off-load data out of an entity or colloection into an 'agreed' XML interface. You expose these methods as web services/HTTPXML objects.

Hope this helps.