Using Same Code for Web Service and DLL Objects

Topics: General Discussion Forum
Aug 21, 2007 at 8:47 PM
Edited Aug 21, 2007 at 8:47 PM
Newer programmer here -
I'm using production (version 2) of web services factory.

I'd like to use the same business entities, business logic, data access. What is the best way to put both a service interface And a (for lack of the proper term) com interface on the same code? Another concern is the database connection is in the web.config file - how can I make the connection string available to web service and non web service? Thanks for your insight.



Tim
Aug 22, 2007 at 7:37 AM
I'm not sure if I got you right, but if what you are asking for is a way to put all your code (aka generate from recipes) in one project, then you should set all the responsabilities to that proyect (notice that some of them might be disabled for dlls).
Regarding your second question, if you want to access that connection string from a library (project) referenced in your web service host project, then simply point to that app settings value using the Configuration API and you should be done.

Hernan
Aug 29, 2007 at 7:32 AM
If you are a newer programmer id recommend keeping the comms seperate from the BLand data (BL and data together is ok) . Getting your BL serialised can create a number of tricky problems -its much easier to translate to simple comms DTO's.

Regards,

Ben