WCF + NHibernate + Web Service Software Factory 2010 - Feedback Requested -
WCF + NHibernate + Web Service Software Factory 2010 - Feedback Requested -
i in process of developing web service used facade perforce server.
in other words, instead of having clients straight contact perforce server, send , receive messages web service, in turn forwards them perforce server. separation done security reasons (i.e.: clients should never have direct access perforce server).
another requirement web service connected sql server database. next research on orms, came across nhibernate. seems have features need in order develop efficient web service, such caching , lazy loading.
i discovered web service software mill 2010, according microsoft "an integrated collection of resources designed help , consistently build web services adhere well-known architecture , design patterns"
here questions:
i noticed web service software mill 2010 has not been updated since 2010. i'm hesitant utilize if framework not kept up-to-date or deprecated. noticed not provide tcp connections endpoints, 1 of protocols wanted utilize transfer info between web service , clients. how adaptable wssf ? can overwrite of generated code ?
does wcf , nhibernate work ? have advice / suggestions give regarding how tackle both technologies ? i'm concerned how create session manager nhibernate in wcf environment.
since performance primordial web service, recommend utilize tcp protocol instead of http ? if utilize tcp, there way in wcf serialize entities want pass on wire, instead of having them converted soap format first ?
as first time utilize wcf , nhibernate, cheer complexity of task @ hand quite daunting. have armed myself tutorials each service separately, haven't found 1 of them working together.
i appreciate if had suggestions / advice offer next own personal experience technologies.
thank time , have day.
1) web service software mill may useful add-on toolbox depending on methodology using project. suggest if taking contract first approach project (i.e. have xsd files utilize messages or have on team going design message , service contracts up-front) wssf may useful.
my personal experience tools did not add together much value mileage may vary. however, guidance worth reading if first serious wcf project.
2) nhibernate , wcf can dream team if right.
one of biggest impedance mismatches using orm , wcf object model can navigated 1 object in model huge , can drag in hundreds or thousands of related objects. lazy loading , powerfulness of nhibernate easy remain ignorant of effect service implementations have on database.
therefore think of import piece of advice avoid sending/receiving domain model objects on wire , design dtos care. forces think explicitly info (or not) set on wire , relationships need navigated. is, if have domain object (mapped using nhibernate), ideally have different dto versions back upwards different client scenarios (e.g. briefa, detaileda, bsassociatedwitha, performtask1ona, performtask2ona, etc.). when you're setting out may seem overkill in long run save time , give much more predictable , maintainable piece of software.
in regard session management there number of ways , pretty straight forward. here starting point.
3) design of dtos of import performance. difference in performance can between dto encapsulating info needed , bloated domain object has cater 30 different scenarios can orders of magnitude.
also utilize standard datacontract/datamember attributes ensure dtos can utilize inbuilt serializers. these extremely fast.
one of fantastic things wcf ability allow transform many aspects of web service through simple configuration changes. changing plain http soap messaging, or changing text binary encoding, or changing net.tcp http transport can done flick of switch or two. makes easy experiment , find optimal configuration requirements. experience binary encoding on net.tcp gives best result on occasions there many factors assume best alternative you.
good luck!
wcf web-services nhibernate orm fluent-nhibernate
Comments
Post a Comment