-
LINQ for SQL unit testing Part2
I'm not really sure whether the benefits are worth it unless you need very high quality code and for larger applications. I'm not sure why i feel this and whether this is due to compartmentalizing the LINQ code or whether its just TDD on LINQ code which can be tested via a test DB i suspect its the TDD.
Still storing all the sql in the various repositories is a plus.
}
---------------------------------------------------------------------------------------------------------------------------internal class ProvinceRepositry : RepositryBase<Province>, IProvinceRepositry{public ProvinceRepositry()base(new ProvinceUnitOfWork())public ProvinceRepositry(IUnitOfWork<Province> work)base(work)#region IProvinceRepositry Memberspublic ProvinceCollection GetWorld(string worldname)throw new System.NotImplementedException();public ProvinceCollection GetWorld()throw new System.NotImplementedException();public Province Get(int id)throw new System.NotImplementedException();public void Update(Province prov)Guard.ArgumentNotNull(prov, "PROVINCE"); public...
-
OO with services
Are OO code and SOA diametrically opposed ? In a lot of ways this is true services tend to produce very anemic object models however this merely reduces reuse which is a myth in OO for the majority anyway .
However services have a unique but familiar problem . The contract of the service is critical it needs to be designed for
- The ease of use of the client
- For performance ( ie chunky calls , many small calls can bring many services down to its needs)
- To be upgradeable and allow backward compatibility.
- Compatible with an...
-
LINQ for SQL and reattaching objects in nTier scenarios
One of the issues that keeps cropping up is LINQ for SQLs support for nTier scenarios and having to reattach the object to the DataContext.
However this problem is exhibited by all ORMs in nTier scenarios ( though not in web sites) and you basically have 2 choices
- refetch the object from cache/DB and replay all changes to see what has changed then you can craft a custom Update to just change the items changed.
- update all fields in the DB.
While the 2nd method is easier the first is more efficient especially when you consider that it...