Click here to Skip to main content
15,887,962 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi,

I have developed a 3 tier application in vb.net 2008 which has User Interface Layer, Business Layer and Data Access Layer.

Now I want to distribute the application in online. I have decided to host the service using WCF.

I have read more articles in the net about WCF. I have learned In WCF single Service Class can host. But we can use multiple interface and multiple data contracts.

But in my application I can't decide how to create service host for my application.

I explain my senerio.
The client application contains UI and BL - in client machine
The WCF service application caontains DL - in server machine
BL and DL communicate via WCF

UI contains more forms ( more than 50) each one have different data contracts

but all forms have some common functions to communicate to DL

so I have decided to define my service contract as common for all forms as below

<servicecontract()> _
 Public Interface SetupMasterFrmServiceContract

      <operationcontract()> _
      Sub DataNew()

      <operationcontract()> _
      Function DataProcess(ByVal xdata As Combositetype,ByVal xMode As Char) As Boolean

      <operationcontract()> _
      Sub DataOpen(ByVal x As String)

      <operationcontract()> _
      Sub DataFetch()

  End Interface


but in the above code in the line
VB
Function DataProcess(<b>ByVal xdata As Combositetype</b>,ByVal xMode As Char) As Boolean


the combositetype is vary for every form. how can I define the service contract for all forms. If I declare interface for every form then it is very vauge to implement the service class.
Please explain how to declare and define my service contract.
Posted

1 solution

The Application should break the UIs among different domains \ modules and then based on that you can define the common data contract that you can use in them.

In case you plan to use a single service for all UIs, the data being passed as Combositetype should have a parent class which is common for all the UIs.
You may have to add an another property in the Combositetype which can identify uniquely the data as to from which form it is coming from.

Hope its helpful to make your decision...
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900