I am in a big fix now

Posts   
 
    
jakkamma
User
Posts: 19
Joined: 03-Mar-2005
# Posted on: 09-Jun-2005 03:40:51   

I used llbgen extensively in a project doing object retrievals, saving objects->related objects through out my code.

Suddenly now our client ( a big fotune 100 ) wants to only use stored procedures and web services to access the DB, no direct hit.

Each request goes thru a web service and we can define web services ourselves.

So Looking to see best way to port code with this new architecture. I did not use Data Adapter, only self servicing.

I am thinking in these lines but a better approach is needed

A generic web service takes a request for say a typeof object ( which can be a llblgen generated object like Customer for Customer table )

and some sql or filter and returns that collection after calling a generic stored procedure ( which takes a table name string or raw sql ?? )

For saving it could be trickier but follow similar design.

How to deal with relations ( I have't used prefetch or fetchpath etc.. )

Any easier way to approach this problem is highly appreciated

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39933
Joined: 17-Aug-2003
# Posted on: 09-Jun-2005 12:24:22   

Hmm.

I can't understand the reasoning of these people, actually. Moving to procs and webservices for data-access effectively destroys the design of an application as you move the paradigm used to something completely different.

So you've to talk to the webservice instead of the db? Because I don't quite follow what they really want: webservice AND procedures or webservice which internally uses procedures and that's not of your business as you talk to the webservice ?

Frans Bouma | Lead developer LLBLGen Pro
jakkamma
User
Posts: 19
Joined: 03-Mar-2005
# Posted on: 09-Jun-2005 12:55:50   

They want my App to talk to WebServices ( which I can develop in any way I want to )

And these web services can talk to DB thru SPs only, no direct data access.

My app currently say a UILayer talsk directly to DB right now using llblgen.

Now some how I have to retrieve these objects by calling webservice ( which I need to write and which in turn calls stored procedures to retrive )

Can U think of a way out

swallace
User
Posts: 648
Joined: 18-Aug-2003
# Posted on: 09-Jun-2005 15:13:52   

Otis wrote:

Hmm.

I can't understand the reasoning of these people, actually.

As I contractor I love situations like this. "There's money in them thar' hills!" smile

The biggest money to be made is from four things: 1) Stupid management decisions and 2-4) Reports, Reports, Reports!

jakkamma, I hope you're getting paid by the hour.

JimFoye avatar
JimFoye
User
Posts: 656
Joined: 22-Jun-2004
# Posted on: 10-Jun-2005 01:48:24   

Talk some sense to the customer or else make some money off him.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39933
Joined: 17-Aug-2003
# Posted on: 10-Jun-2005 11:00:16   

jakkamma wrote:

They want my App to talk to WebServices ( which I can develop in any way I want to )

And these web services can talk to DB thru SPs only, no direct data access.

My app currently say a UILayer talsk directly to DB right now using llblgen.

Now some how I have to retrieve these objects by calling webservice ( which I need to write and which in turn calls stored procedures to retrive )

Can U think of a way out

Well, using entities then is somewhat cumbersome, as you have to convert entities to/from stored procedure calls. Not that hard, but still can be a challenge sometimes. Use adapter, as you don't need the persistence (db specific project) code.

Frans Bouma | Lead developer LLBLGen Pro
Marcus avatar
Marcus
User
Posts: 747
Joined: 23-Apr-2004
# Posted on: 10-Jun-2005 11:34:52   

Otis wrote:

Well, using entities then is somewhat cumbersome, as you have to convert entities to/from stored procedure calls. Not that hard, but still can be a challenge sometimes. Use adapter, as you don't need the persistence (db specific project) code.

If the stored procedures use a consistent naming convention, you could create a template to generate the mappings for you... You'd end up with "Manager like" classes that would call the relevant SPs.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39933
Joined: 17-Aug-2003
# Posted on: 10-Jun-2005 12:12:56   

Marcus wrote:

Otis wrote:

Well, using entities then is somewhat cumbersome, as you have to convert entities to/from stored procedure calls. Not that hard, but still can be a challenge sometimes. Use adapter, as you don't need the persistence (db specific project) code.

If the stored procedures use a consistent naming convention, you could create a template to generate the mappings for you... You'd end up with "Manager like" classes that would call the relevant SPs.

That's indeed a good idea! simple_smile

Frans Bouma | Lead developer LLBLGen Pro