So there exists a bit of a dilemma in the .NET world ... having come from the Java world recently, I think I can probably see it a little more clearly than others.... it is this:
you must use only microsoft tooling, even though it is ages behind the rest of the world
Let me give you one of a few real-world examples to kind of explain what I mean -- let's start with the "you must.." part...............I'm currently doing web apps with C#/ASP.NET - and I would have liked to use an MVC framework...HOWEVER, Microsoft's is not done yet - it's on preview 4 or something... so, the other option is to use Spring.NET or another third party MVC framework... the only thing is: I know Microsoft is working on a MVC framework - and when it's done - they'll make sure there are no competitors - that means there's already a ticking clock on the lifetime of Spring.NET and any other third party projects.... so that's the "you must" part - there's really no realistic choice other than to wait for Microsoft's stuff - or just to not worry about your application becoming *legacy* as soon as you write it.....
Ok - next part - ages behind the rest of the world -- that's right - Java (among others) has had MVC frameworks for a number of years now - they're a well understood thing - they're helpful - and darn it they make you more productive..... why is Microsoft JUST now developing something? Who knows - all I know is that it's way behind the times......
Anyway - that's the dilemma in a nutshell - the fact is - the .NET environment works just fine -- but if you want leading edge power and flexibility -- mmm.. I donno... :)
Tuesday, August 19, 2008
Thursday, August 7, 2008
LINQ to SQL!! Key Conflicts
Ok all - just a cautionary tale... if you see anything similar to the following when working with LINQ to SQL, consider what I'm about to tell you...
"Cannot add an entity with a key that is already in use."
or any other message about conflicts or whatever.....
I've had this problem probably four times, and for some reason, the symptoms still fail to trigger my previous memories.....and btw, there seems to be no tooling around how to figure out what data LINQ is talking about when it makes claims about bad primary keys,etc...(if I'm wrong, please let me know..)
Anyway - I use SQL Server generated identities for rows... and if that is not annotated on the LINQ to SQL generated code, it will not use the generated key - it will assume the key you are giving it is accurate (be it a 0 or null or whatever....)
So just remember this...... it's annoying....and it's probably, overall now, cost me a week of dev time for this project.... BOOOO
:)
Till Next Time...
"Cannot add an entity with a key that is already in use."
or any other message about conflicts or whatever.....
I've had this problem probably four times, and for some reason, the symptoms still fail to trigger my previous memories.....and btw, there seems to be no tooling around how to figure out what data LINQ is talking about when it makes claims about bad primary keys,etc...(if I'm wrong, please let me know..)
Anyway - I use SQL Server generated identities for rows... and if that is not annotated on the LINQ to SQL generated code, it will not use the generated key - it will assume the key you are giving it is accurate (be it a 0 or null or whatever....)
So just remember this...... it's annoying....and it's probably, overall now, cost me a week of dev time for this project.... BOOOO
:)
Till Next Time...
Thursday, July 17, 2008
Behavior and Rest
So here's an interesting angle (from someone that seems pretty intelligent) concerning one of my main disappointments in the 'rest' approach to web services. That is, the rest approach only encapsulates five possible behaviors (corresponding to the five HTTP verbs). In my mind, any other behavior encapsulation doesn't fit in the rest model. This guy disagrees...and he does so fairly eloquently....
http://www.xent.com/pipermail/fork/2001-August/002923.html
Unfortunately, this doesn't cut it for me - because, you're still not encapsulating any new behavior - your factoring it out into its crud operations, and then doing the behavior in the client code. So - it appears to me that rest is just not really suited to situations where you're actually trying to encapsulate behavior (such as non-trivial business logic)... but it is VERY nice for quickly modeling things that can be thought of as a resource or as a piece of data, that you want to be able to view or modify in a sort of low-level kind of way....this resource-centric approach is probably the best part of rest and would probably fit in well with other modes of web service delivery - but because of this short-coming - probably not a suitable replacement........at least IMHO. :)
http://www.xent.com/pipermail/fork/2001-August/002923.html
Unfortunately, this doesn't cut it for me - because, you're still not encapsulating any new behavior - your factoring it out into its crud operations, and then doing the behavior in the client code. So - it appears to me that rest is just not really suited to situations where you're actually trying to encapsulate behavior (such as non-trivial business logic)... but it is VERY nice for quickly modeling things that can be thought of as a resource or as a piece of data, that you want to be able to view or modify in a sort of low-level kind of way....this resource-centric approach is probably the best part of rest and would probably fit in well with other modes of web service delivery - but because of this short-coming - probably not a suitable replacement........at least IMHO. :)
Tuesday, July 15, 2008
We're Not Resources
Why actually blog myself... when everyone else is saying everything.... here's a great post about how insulting and counter-productive it is to manage software engineers as if they were replaceable cogs....let's do like a commentor says, referring to people as "Resources" should be recognized as a bad word in polite, tasteful companies....
http://blog.markturansky.com/archives/95
http://blog.markturansky.com/archives/95
Monday, July 14, 2008
.NET Web App Cheat Sheet
Dude - all I have to say is 'Thank You'...
http://duartes.org/gustavo/articles/Asp.net-Runtime-Cheat-Sheet-HttpRequest-HttpRuntime.aspx
Tuesday, July 8, 2008
Code Monkey...
Cute song - definitely got to learn how to play it...
Here are the chords:
http://www.ultimate-guitar.com/tabs/j/jonathan_coulton/code_monkey_crd.htm
Here's a good music video for it:
http://www.youtube.com/watch?v=v4Wy7gRGgeA
Here are the chords:
http://www.ultimate-guitar.com/tabs/j/jonathan_coulton/code_monkey_crd.htm
Here's a good music video for it:
http://www.youtube.com/watch?v=v4Wy7gRGgeA
Thursday, July 3, 2008
Some .NET Hotness: Stack Traces
Check this link out...
http://neilkilbride.blogspot.com/2008/04/how-to-access-call-stack-c.html
Apparently it is possible to programmatically access the various portions of stack traces in C#/.NET -- this is neat, cause in the java world, last time I checked, you had to manually parse the stack trace generated by a Throwable in order to get any kind of an idea where you were in the call stack... so woo hoo -- give it up for MS - this is kinda hot!!
http://neilkilbride.blogspot.com/2008/04/how-to-access-call-stack-c.html
Apparently it is possible to programmatically access the various portions of stack traces in C#/.NET -- this is neat, cause in the java world, last time I checked, you had to manually parse the stack trace generated by a Throwable in order to get any kind of an idea where you were in the call stack... so woo hoo -- give it up for MS - this is kinda hot!!
Subscribe to:
Posts (Atom)