WCF: Use partial classes to split up a complex Web Service? -


i in process of developing web service should expose relatively large number of ways interact it.

for example, clients may able interact web service in order manage users or projects in database.

to effect, created following classes:

  • two data contracts: iusersservicecontract , iprojectsservicecontract
  • two service contracts interfaces: iusersservicecontract , iprojectsservicecontract

my question following:

does make sense create 2 different web services, each own endpoint(s), instead of creating 1 big class implements both service contracts interfaces ?

keep in mind in reality have many more service contracts interfaces deal different sorts of data.

from understand, using partial class (split in multiple files) allow me create 1 big web service 1 endpoint.

this has disadvantage of dealing 1 big class split in multiple files, i.e: harder maintain , more prone errors if developers "don't see big picture".

the other solution have 1 web service per service contract interface implemented.

in essence, if have x service contracts interfaces, end x web services x endpoints.

which solution choose , why ?

thanks input !

personally not use partial classes splitting class; sheer size motivating tgis split suggests class large , needs refactoring. in opinion partial classes main purpose add changes auto generated code.

since service , endpoint configuration can shared using named behaviours in web.config splitting service should not cumbersome. split should motivated grouping of functionality.

without knowing exact nature of services sounds there natural separation in 2 services; 1 user related operations , 1 project oriented operations.

if implemantation classes grows above think reasonable sizes consider letting separate classes - or preferably interfaces - handle each methods inner logic , let service implementation self shallow facade delegates own method parameters correct logoc instance


Comments

Popular posts from this blog

c++ - Is it possible to compile a VST on linux? -

java - Output of Eclipse is rubbish -

jquery - Confused with JSON data and normal data in Django ajax request -