| William 的个人资料.Net Zone日志列表 | 帮助 |
|
11月26日 MSDN Download issue or Transaction File System issue?
I downloaded the new MSDN library the other day on my new Vista install. The file completed (2gb) but can not be seen in Explorer. When you try to download again, it shows the file exists in the Save As dialog that the new download manager puts up. I suspect it was some weird problem that happened after the file was complete, but before the Transaction completed (i.e. during the check sum verify). However, if the transaction failed, why does the file still exists? Should it not have been rolled back? Now I can't delete it. What to do? 11月17日 Wow. VS 2008 out early next weekCan't believe it is that time already. This will make for a happy holiday. Subscribers will be able to get it here next week under Top Subscriber downloads: 11月9日 Linq Data Services and the Business Logic Layer
Linq is great. However, about the 2nd or 3rd question after using it is "how to I do a 3-tier or layered model with LINQ?..." Unfortunately, there appears to be no easy answer to this. It appears Linq was designed primarily as a client side library for a 2-tier system - and it works great for this. Moving to a layered 3-tier model can still be done, but is not straight forward and still requires a lot of manual work with containment and/or data transfer objects. Microsoft seems to be staying mute on the issue for now until they get some good patterns documented. Myself, I am looking forward to a post promised by Scott Guthery on the issue. There are a few blog posts on different approaches (see Links below). I was hoping Linq to Entities would solve this problem by allowing some form of remote business logic layer (BLL) that would run on the server and could be accessed via Linq to Objects on the client side. It appears that is not the case. IMO, this model is exactly what is needed. Microsoft's Astoria sort of hints at this type of thing but nothing I have seen so far seems to nail the issue head on as I would like to see as a developer. Desired Feature List
A High level example The picture below tries to show how this may work.
[OperationContract] public void PunchOut(int empID) { DbContext db = DbContext; if (!db.User.MemberOf("GoodUser")) throw new SecurityException("Not allowed");
Employee emp = db.Employees.FirstOrDefault(e=>e.EmpID==empID);
if (emp==null) throw new InvalidOperationException("Employee not found");
// atomic test and set example. May need some work.
dbLock(db.TimeEntries.Update) // Grab update lock on table.
{
TimeEntry te = emp.TimeEntry.LastOrDefault();
if (te == null || te.OutTime != null)
throw new InvalidOperationException("Must punch in first.")
te.OutTime = DateTime.Now;
db.SubmitChanges();
}
}Note the method looks like a normal method. However, it uses the LinqToEnties context to get access to the DB. It also has access to db locks from c# code. Not sure how this may actually be Now that is a framework I would really love to see. Hope that makes some sense. -- William Stacey [C# MVP] |
|
|