Wednesday, June 15, 2005

Today, we held our June .NET User Group meeting.  It was great!  Unfortunately due to very late speaker cancellation and other scheduling issues we had to move our meeting from our usual last Thursday's meeting.  David Waddleton, an MSDN Events Team member out of Houston was in town and offered to present to our group a few weeks ago.  Boy! Talk about the stars aligning.

David spoke on Advanced Web Services and touched on quite a few topics that are of interest.  Primarily, he focused on WSE and demonstrated taking what would normally be an unencrypted, insecure SOAP request to a web service and tagged on the Web Service Extensions to encrypt the contents and in essence make the same request to the web server, getting the same results, but in a secure manner.  David also touched on SQL Reporting Services and Http end points in SQL Server 2005.

All very cool stuff.  I was very impressed as well with the turnout.  We had 50+ people there which was unexpected but very welcome!  We had some great giveaways as well: a few SQL Server Standard licenses, Sax.Net Communications Library, Primal Code, and much more.

Thanks go out to the user group members and their support!  What a fantastic user group!

Wednesday, June 15, 2005 2:51:00 PM (Mountain Standard Time, UTC-07:00)  #    Disclaimer  |  Comments [0]  |  Trackback
 Monday, June 13, 2005

Last week, while at Tech Ed, Orlando, I made a post regarding a few feelings around “Code Generation” and “ORM”.  It was an intentional move on my part to solicit some discussion and see where people stood - and I got some very good and insightful comments!

While not really technically related, I kinda view Code Gen and ORM in the same light and I can really appreciate them.  When I say that I don't quite subscribe to their precepts and concepts I do not insinuate that I don't see a place for them nor understand their importance.  And yes, I too feel that Scott is an excellent developer and has some really insightful perspectives on things and a very deep understanding of many aspects of software development.  My previous commentary was, in no way, any disrespect to him, but rather a perspective on somes issues that were discussed.

When presented with a pattern, practice, concept, or a principle which I don't currently implement, I generally take a reserved and cautious view initially (this applies in everything - from software to my personal life).  I am not one to jump on the bandwagon simply because 1, 2, 50, 100 or even 10,000 people say it's right.  If I did that, I'd just be going with the flow, following the stream of jargon simply because something is deemed as cool or modern, and not making my own decision based on my own understandings, experiments, and/or implementations.  Sometimes the old school teachings and principles still have merit.  Majority doesn't make something right, it just makes it popular.

Then again, I'm not saying that neither Code Gen nor ORM are 'wrong' per se, I'm simply stating that I don't currently implement them in my development process to the extent that others do.  This isn't because I love CRUD programming, but because I take a slightly different approach to writing software.  I hope to explain a bit more below.

Code Generation

Of the two, I am more reserved about code generation.  Sure, writing boilerplate code is pretty tedious, repetitive, prone to errors, and much more, but how often is data access code truly boilerplate?  If all your code is doing the same thing (e.g. creating a connection, opening it, running a command, disposing of resources, etc), perhaps you should revisit that.  It might be helpful to have some centralized data access module or library.  Then again, if you do that, one could argue that it's more the case where code gen is feasible, and I can understand that too.  As I see it, the most boilerplate code would exist not in a DAL (because of library autonomy), but in domain objects where properties map more directly to data fields and the properties are simply getters and setters to an underlying field.

There sure is a tendency within the industry to promote code generation and it's definitely not lost on Microsoft.  In fact, as Matt mentioned in his comment earlier, there are several new enhancements in the VS 2005 timeframe that really seem to promote this: DSL Tools, GAT (Guidance Automation Toolkit), Software Factories, and partial classes.  Things which are frankly pretty awesome!

I believe that there is an inherent brittleness in code-generated objects.  Business requirements change.  Data storage mechanisms change or vary between objects.  Actions pertaining to object vary widely.  I would be lying if I said that all my business and/or data objects behaved the same.  I find myself decorating classes with attributes (e.g. GuidAttribute, ClassInterfaceAttribute, SecurityRoleAttribute, DescriptionAttribute, and many more) that vary on a class-by-class basis or a method-by-method basis.  Almost ALL of my programming is interface-driven programming (especially when I'm creating EnterpriseServices-based (COM+) classes).  There is code within each method that validates parameters passed from the business tier, performs operations on them, calls stored procedures, builds objects, and much more.  The stored procedures also validate data, update multiple tables, call other stored procedures, and much more.

I can't see these objects being generated automatically for me.  Far fewer than 5% of my procs are as simple as SELECT ID, Name FROM Customer or UPDATE Customer SET Name = 'xxx' WHERE ID = x or DELETE FROM Customer WHERE ID = x.  Were that the case, I'd have hundreds upon hundreds of stored procedures that all look alike, are not maintainable, and don't really buy me anything.  I could simply use ad hoc queries instead.  Additionally, each stored proc has security settings, permissions granted to specific applications and/or users.

The VAST majority of my procs are actions that are performed on the domain objects such as 'Complete Task' or 'Place Order'.  I cringe at having to retrieve a Task object, setting its Completed property, and then calling Update to save it to the data store - such a method might require a bunch of business logic to run or a multi-step database operation.

Perhaps code generation is more template based than I'm willing to let on.  Template-based code generation, in my mind, has must more merit and is much more attractive than what I'll call 'reflective code generation'.  I have seen some really fantastic XSD-based and WSDL-based templates that DO allow for some pretty tight classes to be generated (something that Scott did illustrate in his presentation)...I will be looking into that more here in the future.

All said, however, I truly see a use for code generation and will probably employ it in the very near future.  Heretofore, I could not honestly get behind it 1) for fear of losing any tweak or change I made the next time the code is regenerated and 2) perceived lack of control over the resulting classes.  With the advent of partial classes in .NET 2.0 I can really see its practical usage.

ORM

I tend to view ORM implementation in the same camp as Code Generation because of the tools that automate the creation of the objects.  The chief tenets behind ORM, however, I can definitely get behind.  Having some form of a 'mapper' class that can create, update, and manage domain classes is paramount to almost all development projects.

My object hierarchies don't frequently mirror my database relationships, though similarities often exist.  Generally speaking, I don't believe it's a good practice to push the database organization onto the business tier or the UI tier.  Sure, sometimes object hierarchies and relationships are understood and rather apparent (e.g. Customer -> Orders -> Order Details) and lend themselves to an object hierarchy, but that, in my mind, is an operation of the UI and business layers - I shouldn't have to knowingly navigate an object hierarchy to simply get the single order detail I want.  I should be able to go right to it if I want.  Likewise, when I commit a change, I shouldn't have to send an entire object graph to a data layer to have the entire thing analyzed to simply update a misspelling somewhere deep in the hierarchy.

Each application has its own solution, and for some ORM is the right solution; I tend believe it's more the exception than the rule.

Though I do practice several ORM principles in my code, I can't honestly say that it's pervasive, and it's not generated.  I can definitely get behind the ORM bandwagon more easily than I can the Code Generation one.  In the days to come I will be experimenting more with it to gain a deeper understanding and will report back with my findings.

Monday, June 13, 2005 6:45:00 AM (Mountain Standard Time, UTC-07:00)  #    Disclaimer  |  Comments [9]  |  Trackback
 Saturday, June 11, 2005

I have a CAPTCHA control installed on this site and for the most part it's done a great job of filtering out spam comments on this blog.  Lately, however, I've been the target of some PingBack/TrackBack spammers and it's really driving me nuts!  I have to literally clear out 50+ a day.  Does anyone have any PingBack/TrackBack spam blockers they would recommend, or should I resort to creating my own 'black-list' plug in for .Text?

Thoughts?

Saturday, June 11, 2005 5:30:00 PM (Mountain Standard Time, UTC-07:00)  #    Disclaimer  |  Comments [1]  |  Trackback

Well, I'm home at long last.  I have some wrap-up comments regarding Tech-Ed (which was a blast!) that I have yet to post, but I simply have not had a chance to do it yet.  It is so good to be home and start to settle into a more manageable and regular routine.  It's been so hectic lately that I've not really had a chance to work on anything that I want to work on or get anything done around the house (tasks which are far past-due it's not even funny).

I also will be addressing some comments that were made on my blog recently and will try to get to that tomorrow.  Thanks everyone for your continued support and encouragement!

Saturday, June 11, 2005 5:27:00 PM (Mountain Standard Time, UTC-07:00)  #    Disclaimer  |  Comments [0]  |  Trackback
 Tuesday, June 07, 2005

Tuesday (yes, I'm posting this after 4:00 AM on Wednesday), was pretty interesting.  We discovered that SQL Server 2005, Visual Studio 2005, and BizTalk Server 2006 will all be released in the first week of November!  I'm looking forward to that!

I attended Scott Hanselman's talk this morning on Code Generation.  While the presentation was pretty cool (and he's a fantastic presenter), Code Generation is kinda like ORM to me...I don't quite subscribe to the concepts.  His talk was definitely interesting and full of great details and information, but one thing he didn't touch on (probably partially due to time constraints) was how to get to a point where code gen is feasible.  It's one thing to see how it might be beneficial - and I can comprehend many instances wherein it would be useful - but getting from a point where code gen isn't part of the picture to a fully automated, code gen'd state appears to be complicated.  It requires several things:

1.  Buy-in - at some level management and the dev team need to have buy-in that such an investment is worth it in the long run
2.  Time - getting to the point where code gen is feasible will take some time...it's not something that you can crank out overnight, though it probably can be phased into the dev cycle.
3.  Understanding the tradeoffs - unless I missed something, code gen kinda locks you into a particular implementation.  It, like ORM strategies, in my mind seems to make the system more tightly coupled around a few principles established in the XSD/WSDL schemas and templates, thereby making all business objects look and act the same.  If the logic / procedures needs to change, they're going to change everywhere and you have to re-gen everything.

Maybe it's just really late (early?) and I can't think straight.  I did, despite these comments, thoroughly enjoy Scott's presentation and will try to follow up with him on some of these concepts for my own enlightenment...I know I have a lot to learn.  Maybe I just need the blinders removed.  I'm sure it has its place.

Following Scott's presentation (which happened to be one of the reasons I wanted to come to Tech-Ed in the first place), I attended a few presentations on SQLCLR (which was incredibly dull so I left) and IIS debugging.  I then had to return to the hotel to wrap up some code for a client so I didn't even get to attend the Birds of a Feather presentations :-(.  I'll try to hit them tomorrow.

Tuesday, June 07, 2005 7:28:00 PM (Mountain Standard Time, UTC-07:00)  #    Disclaimer  |  Comments [2]  |  Trackback
 Monday, June 06, 2005

Today was a pretty exciting and interesting day.  I attended several sessions in which the presenter(s) showed some exciting and compelling information.

To start off the day, Jonathan Keljo (a Program Manager on the CLR team at MS) discussed best practices regarding exception handling.  Of the information shown I was already well versed and well aware, but at the end of his presentation he discussed a new method called RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup() which is available in the Whidbey timeframe.  This method is pretty slick because it allows delegates to run before catch and finally blocks run, thereby preventing a malicious exception filter from running in a catch block before some sensitive state (e.g. administrative impersonation, etc) can be reverted. Very cool!

I was less than impressed with the Building and Using a Software Factory presentation...very boring and not at all what I was expecting.  The chemistry of the presenters was non existent as well.

Richard Campbell and Stephen Forte gave an energetic and sometimes funny (though it started to border on annoying) presentation on Advanced Querying Techniques, Tips & Tricks using T-SQL.  They demonstrated CTEs (Common Table Expressions) which will be available in Yukon (SQL Server 2005) as well as the various Ranking and Windowing functions that will be available (Row_Number(), Rank(), DenseRank(), and NTile(x)).

The final (and perhaps best and in-depth) presentation I attended was by Kimberly Tripp entitled Understanding Index Usage and Indexing Best Practices in SQL Server 2005.  She had some very good tips and her presentations and demos are (or at least will be) available at www.SQLskills.com.

Despite one disappointing presentation, today was awesome.  Tomorrow looks to be just as promising.

Monday, June 06, 2005 4:05:00 PM (Mountain Standard Time, UTC-07:00)  #    Disclaimer  |  Comments [0]  |  Trackback
 Sunday, June 05, 2005

Today, one day before the official conference actually begins, we had a very special INETA- and Culminis-hosted event entitled 'User Group Leader Summit 2005'.  It was a pretty exciting day and much information was gathered and shared.  We started off with a few keynotes.  The first by David Thompson (corporate VP of the Exchange Server Product Group at MS) who spoke, oddly enough, about Exchange.  Though it did not really pertain to me or my interests, I found it somewhat interesting and am looking forward to the next version and am excited about the work being done on it.

The second keynote, presented by Ari Bixhorn (Director of Web Services Strategy in the Developer and Platform Divistion at MS), was on Indigo.  This was, perhaps, one of the best presentations I've seen.  Ari had such a great demeanor and flow and his preparation was evident.  He took a difficult topic and condensed it down to about 45 minutes and did so in such a manner that everyone could understand it and internalize it.

Following a few more sessions and lunch we broke out into four 1-hour workshops focused on how to better our User Groups (in terms of leadership, community, web presence, newsletters, etc).  Despite the differing perspectives and sometimes obnoxious and arrogant personalities present, I gained several new and thus far unexplored ideas that will be a great boon to our local .NET User Group in Utah.  I am looking forward to sharing some of these ideas with our group and leadership and we should see some great things coming due to it.

All in all, it's been a long day, but a fruitful one at that and I'm looking forward to tomorrow when the conference officially gets underway!

Sunday, June 05, 2005 11:04:00 AM (Mountain Standard Time, UTC-07:00)  #    Disclaimer  |  Comments [0]  |  Trackback
 Saturday, June 04, 2005

Well, I arrived here in beautiful (and rainy) Orlando, Florida for this year's installment of the much anticipated Microsoft Tech Ed conference.  I am so looking forward to it and have a great week planned out.  I anticipate making a log of the events and talks that I attend and will report daily on them.

Tomorrow will, by all accounts, be a full day.  I have meetings from 8:00 AM - 8:00 PM all about the User Group leadership and community and it looks to be PACKED full of useful and exciting information.

I'll keep everyone posted.

Saturday, June 04, 2005 2:14:00 PM (Mountain Standard Time, UTC-07:00)  #    Disclaimer  |  Comments [0]  |  Trackback
 Monday, May 30, 2005
I was perusing some blogs today and stumbled upon this interesting post.  Intrigued, I had to investigate.  My high score, though not yet matching his, is 1579.  It's pretty hilarious.  I almost fell out of my chair laughing the first several times I tried.  Try this, for a direct link to the game.
Monday, May 30, 2005 6:31:00 AM (Mountain Standard Time, UTC-07:00)  #    Disclaimer  |  Comments [0]  |  Trackback