this is interface to the underlying storage mechanism so that you do not care about its details when developing ViewModels. When you need an entity call Select<IBankAccount>() , when you need to delete call entityBus.Delete(bankAccount) and when done call entityBus.SaveChanges().

IentityBus is not specific to Domain object and you do not have implementation for each domain class. You create implementation for each persistence mechanism. You use one object to select each all domain classes

for example

var entityBus=new NHibernateEntityBus();

var all_bankAccounts=entityBus.Select<IBankAccont>();
var all_transactions=entityBus.Select<ITransaction>();
all_transactions.First().Amont+=500;//registers for update


EntityBus is UnitOfWorkrepositoryIdentityMap

this is like EntityFrameworks ObjectContext but you can have other implementations

Last edited Sep 21, 2011 at 5:10 PM by tsadigov, version 2


No comments yet.