Rockford Lhotka

 Wednesday, December 28, 2005

I apologize for the shameless plug, but I thought this was rather cool:


I see that my Expert C# Business Objects book has been nominated for the .NET Developer's Journal (.NETDJ) Magazine 2005 Readers Choice Award in the

category of Best .NET Book/Training Software.


I would appreciate your vote so that the book can win this highly prestigious award.  You can also cast a vote for various other favorites you might have in other categories. As part of the voting process, you can also get a free subscription to the Digital Edition of .NETDJ.


Cast your vote at: 

To begin voting, click on the "Click Here to Vote Now!" link.


Voting Ends Midnight, December 31, 2005


Thank you!

Wednesday, December 28, 2005 10:56:47 AM (Central Standard Time, UTC-06:00)  #    Disclaimer
 Tuesday, December 13, 2005
I am at the point now where I think the resource.resx file for CSLA .NET 2.0 is stable. Of course it is only in English at this point, and so I am putting out a call to anyone willing to translate the file to other languages.
Thanks to volunteer efforts, CSLA .NET 1.x has resources in a total of 11 languages, which is simply wonderful!
If you are willing to translate the resources to your language, many people would appreciate your help.
The English resource.resx file can be downloaded here:
If you are able to translate the file, please email me the resulting translation and I'll incorporate it into the solution so it is available when the book comes out (anticipated for the end of March 2006).
I'll keep a log of the languages as part of the CSLA .NET 2.0 Change Log, so you can check there to see if your language already has a translation.
Thank you!
Tuesday, December 13, 2005 4:55:14 PM (Central Standard Time, UTC-06:00)  #    Disclaimer
 Wednesday, December 7, 2005

Slashdot has some funny ones from time to time. Like this one, where the author contends that AJAX is a new Microsoft technology.

(note: the article he links to about AJAX is worth the read!)

But AJAX isn't new. It is old - many years old, for all that it didn't become popular until recently.

And it was the tech darling Google that made it popular, not Microsoft.

Sure it is based on technology Microsoft put in the browser many years ago, but until Firefox added support and Google used it broadly it was a sleeper...

But on slashdot everything negative must be associated with Microsoft - it's a rule I guess...


Wednesday, December 7, 2005 7:42:46 PM (Central Standard Time, UTC-06:00)  #    Disclaimer

It is the debate that never ends (though it does change shape): is the current C-style language infinitely superior to the current most widely used language.


Years ago COBOL and FORTRAN were all the rage. Then this upstart C language showed up claiming to be better. Which was laughable, but the fanatics in the C world wouldn’t give in.


Eventually, seeing that C wasn’t going anywhere, they added ++ to the end, claiming that extra non-alphanumeric characters improved the language so now it was better than FORTRAN. (and it was better actually - and no one compared anything to COBOL because that would be just silly - almost as silly as acknowledging that RPG was a programming language at all)


But then the age-old and much maligned BASIC language grabbed headlines by offering a level of productivity for GUI programming (on Windows at least) that no one else could touch. All of a sudden the semi-colon lovers of the world had a new enemy: Visual Basic.


And while C++ was much faster and provided access to the deep, dark, smelly bowels of Windows (16 and then 32 bit), the fact is that it took many times more code to do anything in C++ as compared to VB. So while the VB devs were at the bar drinking, or at home with their families, the “superior” C++ devs were slaving away trying to find that missing semi-colon or mis-matched close bracket (or worse, that null pointer reference).


That’s why Java was invented: to try and create a version of VB that had semi-colons. Get rid of all the low-level machine issues like null pointers and memory deallocation so programming is more VB-like, yet keep the elegant (cryptic?) syntax of the C-style language family. Unfortunately Sun just didn't get it (and still doesn't...), so Java missed the mark for the GUI developer.


But Microsoft has always understood. They created VB after all. So naturally that’s where C# comes from: VB with semi-colons. As Billy Hollis has said numerous times, the VB community kindly allowed the rest of the world to use the VB runtime. Sure, it was modified to be useful from other languages, but .NET brought to the C-style world what VB had been providing for over a decade: productivity.


(btw, if you didn’t catch some of the sarcasm and hyperbole in the above you really need to lighten up…)


So what brought on this post? Tom Archer explained why there are so many VB samples on MSDN, stirring the debate yet again.


By the way, the reason there are so many VB samples boils down to two things:


First there’s the fact that there are more VB developers out there than C# developers. A lot more, pure and simple.


Second, Basic was designed specifically to cater to the way people think. C-style languages were designed specifically to cater to the way machines work. It is incredibly obvious then, that Basic is a better teaching/learning tool, because it is based on cognitive concepts for humans.


(note that I’m not saying one language is inherently better for actual programming – just for learning)


Either way though, I’ve said it before and I’ll say it again: if you only know one language family you are crippling yourself. If you’ve only ever use Basic (VB or otherwise), or a C-style language you really need to broaden your horizons.


If you can’t stomach learning the “enemy” language (VB or C# depending), then go find another .NET language like FORTRAN, Eiffel, F# or something. For that matter, IL itself is a great choice.


Branch out! Learning other languages only helps you understand and use your preferred language better.

Wednesday, December 7, 2005 11:04:57 AM (Central Standard Time, UTC-06:00)  #    Disclaimer
 Sunday, December 4, 2005

Recently there was a thread on the CSLA .NET discussion forum dealing indirectly with open source. I started replying, got carried away and decided to divert the bulk of my thoughts into a blog entry. They span both commercial and open source topics, so this post covers a wide spectrum of my thoughts.


The thread started by someone suggesting that I should make CSLA .NET (the framework in my Expert VB/C# Business Objects books) into a commercial product. Not surprisingly someone else suggested the exact opposite: that I should relinquish ownership entirely.


My short answer: “Though this will disappoint both ends of the spectrum, I don't anticipate any major changes in the CSLA .NET license for CSLA .NET 2.0.”


To make CSLA .NET into a commercial venture I'd need to leave Magenic and actually start a software company. That's something I'm not real eager to do. I worked for an ISV early in my career and it is a whole different world from either IT or consulting.


Not that working for an ISV is (or was) bad. In fact it was kind of nice in some ways.


When you are in IT you have nothing to do with the product. You don’t actually make what the company makes, you make and/or maintain software. The rest of the company does what the company does and you do something else that they don’t understand or like. If anything, you cost them their jobs by automating their tasks, so they don’t like you. Typically you are tolerated as (at best) a way to save the company some money, but more likely as a necessary evil.


When you are a consultant you are the product. You don’t make the product, you are it. You’d think that makes you valuable, but it actually doesn’t. The work you do for clients isn’t the product – in that regard you are essentially a temporary part of IT. Your time itself is the product. To make it worse, clients often dislike you, viewing you as an uncaring mercenary, or as someone out for their job. More commonly clients like but distrust you, expecting that you can’t be worth the rate your company charges for your time.


But working for an ISV you are actually making the product. You are actually the assembly line worker, the engineer, the craftsman. There’s a certain pride to actually doing what the company does that you just don’t get in IT or consulting. However, you get the same respect (in my experience) as an assembly line worker; which is to say not a whole lot. Deadlines are often shorter and harder than in IT or consulting, and what you do or don’t do directly affects the viability of the company and your job.


But hey, my personal motivation for not wanting to start an ISV and make CSLA .NET commercial? I love what I do right now at Magenic. I get to do a wonderful mix of consulting, writing, speaking and various other activities. When I describe my job to the occasional headhunter they just shake their heads and walk sadly away, because it is virtually impossible to see how anything could compete…


Yet making CSLA .NET entirely open source (as in giving up ownership) doesn't make sense to me either. I am quite sympathetic to open source in general, and CSLA .NET is open source in many regards (most notably the literal one: the source is open).


But I make my living off building software, and I put a relatively high value on the massive amount of time and effort I've put into the books and framework over the past 9 years.


I subscribe to the free-as-in-speech view of OSS, and I think CSLA .NET meets that requirement. My thoughts are in the open, as is the code. They are not just open, but published for all to see. My licensing terms are comparable to some open source licenses where the author retains copyright ownership, yet provides open source and nearly unrestricted terms of use.


I do not subscribe to the free-as-in-beer view of OSS at all. I believe that what I (and all of you as software professionals) do has a high value. That we provide a professional, specialized and valuable service and we create highly valuable products as a result. To release ownership of those products and to simply give away the fruits of our labor makes no sense to me I'm afraid.


The frequent counter-argument is that the software should be free-as-in-beer and we should just all charge for our time. Give the software away and charge by the hour for support or targeted enhancements. And that’s a workable model commonly called consulting (see above).


And sure, getting paid for time makes sense when you are young. But getting paid for your results makes a lot more sense when you are older. Time, I have found, gets more valuable in a non-linear manner as you age, and even consulting rates can't match that acceleration.


Not that I'm that old. But having kids and getting involved in community and family and so forth really seems to occur when people are 35-45. It is at that point in life that it becomes quite apparent that it isn't possible to charge by the hour and get what you want out of life. You need to charge by your results, because they are frequently worth a whole lot more than just an hour of your time.


The nature of my arrangement with Magenic, combined with my overall life of writing and speaking means that I am able to put my ideas in books, on my web site and talk about them at conferences in a manner that is effectively free. Not only as in speech, but as in beer. But through it all, I retain ownership of my results; which is a key factor in my being able to continue doing what I love.

Sunday, December 4, 2005 10:55:33 PM (Central Standard Time, UTC-06:00)  #    Disclaimer
 Thursday, December 1, 2005

I’ve recommended David West’s Object Thinking book to many people. I really like the book a lot, and think that his underlying message has tremendous value. But the trick with the Object Thinking book is to take the concepts and philosophy and to adapt it into existing tools.


David walks through examples assuming a clean slate. No pre-existing framework like .NET or the JDK. No data binding, nothing. And that's good for making his point, but is somewhat silly in the real world. It is hard to imagine ignoring data binding or all the other powerful plumbing built into .NET...


Likewise, he ignores the value of IDEs. Take away Intellisense and VS becomes pretty crippled. Yet building all objects as collections of field values basically means that they all become Dictionary objects with business rules attached. No more Intellisense or compile-time checking of anything. Ouch!


So in my mind the value of Object Thinking isn't in the idea of creating objects at such an incredibly low level that you lose the value of .NET or of VS.


Rather it is in the view that objects have a single responsibility. That they are defined by their behaviors, not by their data. It is in the understanding that no class should be overly complex. If it starts to become complex it is because you aren't factoring the behaviors properly, and aren't effectively leveraging collaboration between your objects.


You could look at CSLA .NET and wonder why I like Object Thinking. After all, CSLA .NET can help you build some very data-centric object designs. But CSLA .NET can also help you build some very behavior-centric object designs too. That’s really your choice!


From a behavioral perspective, CSLA .NET merely provides (in 2.0) six broad templates:


·        Editable single objects

·        Editable collections of objects

·        Readonly single objects

·        Readonly collections of objects

·        Command objects

·        Name/value lists


All of which tap into a whole set of underlying concepts including data binding, mobile objects and object persistence.


But the goal is to allow a business developer to design a set of objects that have business-specific responsibilities that are better enabled by leveraging this pre-built functionality.


A Customer object’s responsibility may be to record valid customer data. By inheriting from BusinessBase, the business developer can focus purely on the behaviors necessary to fulfill that responsibility. The object automatically gets data binding, mobile object and object persistence concepts with essentially no effort. The focus is on the business responsibility and behaviors, not on plumbing.


But other objects won’t inherit from CSLA .NET. This, I think, is the biggest single hole in how people use my framework. A real business system has many objects that interact with data, true. But collaboration and behavioral OO modeling means that there should be a lot of objects that don’t interact with data. Rather they implement pure behavior!


These may be following the observer pattern or other design patterns. They may be business rule implementations, or implementations of business algorithms like pricing or taxing. There’s a whole ton of behaviors that often don’t belong in a BusinessBase-derived object, but rather belong in their own object. Then a BusinessBase-derived object will collaborate with these other objects to do its work.


To me that’s the value in West’s book. The philosophy of each object having a single, clear responsibility. Of objects collaborating with other objects to perform complex tasks, without being complex themselves.

Thursday, December 1, 2005 9:34:11 PM (Central Standard Time, UTC-06:00)  #    Disclaimer
 Friday, November 18, 2005

I’ve posted a couple times before about what a business class will look like in the next edition of my business objects books and thus in CSLA .NET 2.0. One of those times Jason Bock (a fellow Magenicon) sent me an email asking why the DataPortal_Create/Fetch/Delete methods aren’t strongly typed.


If you look at the current approach and what I’ve posted thus far for the next edition you’ll see code like this:


Protected Overrides Sub DataPortal_Fetch(ByVal criteria As Object)


protected override void DataPortal_Fetch(object criteria)


Jason’s comment got me thinking. The DataPortal uses reflection to invoke this method, so why not be a bit more thorough in identifying the method’s parameters and invoke a strongly typed version like this:


Private Overloads Sub DataPortal_Fetch(ByVal criteria As Criteria)


void DataPortal_Fetch(Criteria criteria)


Where Criteria is the actual type of the criteria object provided when calling the DataPortal.Fetch() method back in the factory.


(the Overloads keyword is required because the base class still implements the default protected version)


As with many things, this sounded relatively trivial but turned out to be somewhat harder than expected. It is always the edge cases that make things hard… In this case the hard part is that parameters could be Nothing – in which case you don’t know what type they would be if they weren’t Nothing...


After working through that issue all is well.


This (in my opinion) is better than the alternative, which was to go with an interface-based approach and formalize the late-bound concept. That has its attraction, and people have altered CSLA .NET 1.0 along that line, but I really prefer strong typing if I can get it.


In particular this is nice for collections, where you may have multiple criteria classes for different views – now you can just implement a strongly-typed DataPortal_Fetch() method for each criteria class. Very clean and nice.


I’m still deliberating over whether to leave the default protected implementations in the base classes. They are nice because VS helps you override those methods, but they aren’t optimal. Given that VS has such nice snippet support it may be better to drop the protected defaults and just rely on snippets to insert the DataPortal_XYZ methods.


If you have an opinion, feel free to comment :)

Friday, November 18, 2005 6:02:25 PM (Central Standard Time, UTC-06:00)  #    Disclaimer

This link was posted to the CSLA .NET discussion forum. It uses Google Maps and superimposes the locations of CSLA .NET users who've entered themselves on the site.

That's just way too cool! :)

Friday, November 18, 2005 12:16:08 PM (Central Standard Time, UTC-06:00)  #    Disclaimer

ClickOnce is a great technology, but it seems that documentation is a bit scarce... In particular, like all web-based technologies, it requires some obscure configuration. The web may be great in some ways, but it does often require that you have a lot of arcane knowledge to do even the simplest thing...

This forum thread covers the little-documented fact that for IIS 6.0 the web server serving up a ClickOnce application needs to map the .application, .manifest and .deploy file types in IIS as follows:

.application -> application/x-ms-application
.manifest -> application/x-ms-application
.deploy -> application/octet-stream

While this may be documented somewhere, it seems quite hard to find. Thus I'm blogging it. If a few people blog the answers to common questions than at least google finds them for people :)

Friday, November 18, 2005 8:44:21 AM (Central Standard Time, UTC-06:00)  #    Disclaimer