| Profilo di BenBens HouseFotoBlogElenchi | Guida |
|
03 aprile SQL - I don't like it.Imagine the following Database setup
TableA has an ID column, AID
TableB has an ID column, BID
Table AB has 2 columns, AID and BID which realte to the IDs from TableA and TableB respectively.
Now imagine you want to delete one of the references between an A and a B from TableAB, easy.
DELETE FROM TableAB WHERE AID = @AID and BID = @BID
Now tidy up so that any As that aren't referenced by a B are removed
DELETE FROM TableA WHERE AID NOT IN (SELECT AID FROM TableAB)
You might want to throw those two lines in a stored procedure, call it DeleteAB. Now how do we delete all AIDs which are referenced by a specific BID whilst still keeping TableA as clean/empty as possible? One of two ways...
Or the quicker way...
The thing is, whilst I much prefer reading the SQL code for the second version, I hate the lack of architecture behind it. If we make an alteration to the Database so that A is not used somewhere else, the first example need only alter the StoredProc, whereas the second solution would need an alteration for both the single deletion and multiple deletion methods. In the world of a normal programming language (C# as an example) we'd more than likely go with the architecturally sound version -
Why do we get sloppy on the design with SQL? Because we need the performance of the inline code. Not that I like it. 02 aprile Microsoft Surface in AT&T StoresI was reading this article (Microsoft Surfaces finds home in AT&T stores) when I wondered how many people wont understand the idea of dragging an icon on a touchscreen. Think about it - a big icon on a monitor looks like a button, so you expect to press it. Thanks to the last 30 years of computing, we expect to be able to click/press most things on a monitor and although dragging might make a lot more sense from some angles (to put a ringtone on the phone you drag the ringtone to the phone) we've had too many years of clicking-not-dragging to expect this change to work overnight. Is this what's preventing more touch specific applications for the tablet PC? And how did Apple manage to do touch so right with the iPhone? 01 aprile Has Microsoft Lost Its Way On Desktop Computing?Actually, I agree with this article on ZDNet (Has Microsoft Lost Its Way On Desktop Computing?) which basically says "yes", so this could be a very short "me too" blog post. And it is. |
|
|