silverlight - Should I duplicate my Entity Model? -


let me set lob scenario.

i re-writing our core business app. requirements create internally usable app (i'd use silverlight) our employees use on daily basis. need provide soap service can used input orders, invoices, etc.

i doing in pieces, when update record in new sql server database, need make sure update our legacy sql server well.

so, makes sense create dal pull data new sql server, write 2 data stores.

it make sense create bll can used both silverlight/ria , wcf web services.

i have created data entity of new database in it's own project , used in other projects. problem here ria seems require create right inside asp.net project in order metadata silverlight. without this, need manually re-create metadata silverlight access correctly.

my question then, should create duplicates of entity model? 1 ria , 1 else? there better way this? should forego using ria , have silverlight access wcf services? or should continue duplicate metadata in ria?

we use entities direct reference storage , data transfer objects (dtos) identical passing back/forth between bll , wcf/gui/etc. map between 2 using automapper means there's little additional work don't have worry if given entity attached context/tracking state changes/etc...

edit: want keep code dry possible. personally, i'd @ using dtos above bll , either having 2 sets of repositories co-ordinated in dal (one rw, 1 w only). or having meta-repositories handle datasets on 2 stores themselves.

if you're not using it, unity , ioc of real benefit here. might want use 1 of modular code patterns allow register [n] data stores in different modes, when want retire old store, don't need work.

i'd question whether entities need defined in asp.net - may simple able reference appropriate dlls entity/dto project , add appropriate markup/config


Comments

Popular posts from this blog

android - Spacing between the stars of a rating bar? -

html - Instapaper-like algorithm -

c# - How to execute a particular part of code asynchronously in a class -