Should I add WCF to my ASP.NET MVC site to feed data to mobile apps? -
[i've never used wcf before. i've been googling couple days , haven't found info makes decision of whether or not use obvious me.]
i've been developing website using asp.net mvc, linq sql, , sql server.
now want develop mobile apps fed data site's db.
it has been suggested me use wcf this.
i know if have data facing public internet, can scraped if wants it, i'd minimize "scrapablility" of data.
since mobile apps sending/receiving data in json format, benefits using wcf instead of restful json-returning uri's in mvc?
and if implement wcf, should mvc site hitting services data instead of using linq in controllers?
i've got asp.net mvc application hitting wcf. developed without wcf having controllers interact service layer hits repositories. requirement came during development required me physically separate ui service layer.
adding wcf pain in rear. things worked without wcf no longer worked afterwards. example, state of entities lost upon transmission to/from service layer making difficult utilize features of orm (nhibernate). no longer retrieve entity, map viewmodel entity in controller, , allow nhibernate determine whether or not update necessary.
that said, challenges associated wcf incurred @ beginning. don't need revisit configuration , i've gotten used working detached entities. have benefit of physical separation , wcf extremely flexible.
would use wcf if needed web services not separation? don't know. try make json action methods work because easier (not mention more fun). keeping simple still wonderful principle.
as mvc site hitting services? think it's safe action methods should thin , there should little business logic or persistence concerns within mvc project. separation of concerns makes easier adapt , change application.
Comments
Post a Comment