Andy Smith's Blog

Page.RegisterStartupScript('Andy', 'MetaBuilders_WebControls_GainKnowledge();');

May 2003 - Posts

new control
That new ParsingContainer control I mentioned the other day is now available. Hope you like it.
I'm such a tease

I'm not usually one to hint at a new metabuilders control before yall can actually download it... but be prepared for a new doodad that I think will really help dynamic sites.

Think of the following requirements for a "news" or blog site.
1) All posts get stored in a DB as text.
2) Posts can contain arbitrary asp.net content, including controls.
3) A specific control to support includes hyperlinks which use ~ in the NavigateUrl to specify the app root.
4) Posts are databound from a dataset to a template column.

Or maybe these:
1) data in xml
2) transform to xslt to dynamicly generate asp.net "html" which contains server controls
3) build the page's control tree from that transformation.

Right now, there's no code-free way to do it, and most people will just say , "you can't".  But in fact, I already do it on the main page of metabuilders. Ironicly, I just never thought to package the behavior into a control. Soon I'll have a control available that quickly and easily satisfies both of these requirements.

Thoughts on my trip to MS

I spent much of last week in sponge mode in an Microsoft asp.net design preview, absorbing all kinds of stuff about the next version of asp.net, with some c#, sql server, and web services stuff thrown in for fun.

Of course I can't say too much, but I can tell you that the 70% code reduction goals for asp.net apps are very much NOT hype. Those guys have done some amazingly neat stuff. Some of the new v2 features will allow me to make some insanely cool controls that are just barely beyond the reach of v1.

Right now, asp.net v1 is beginning to feel like my Matrix dvd. Sure, it kicks all ass... incredibly revolutionary... and has the advantage that I can actually use it in my home... But now that Matrix Reloaded has been seen... I'm kinda holding my breath for the day I can buy the dvd and bring it home.

And the talks from Andres Hejlsberg and Don Box left me in a euphoric state. Did I really sit down in a room with these guys?

Which leads me to the whole other half of it... the people. This was my first chance to meet any of the guys i've been IM'ing and such over the past few years. The technical stuff was amazing, and I feel honored that the asp.net team thinks my feedback is useful... but what's going to stick with me is the handshakes and smiles.

setting focus the _really_ easy way.
I've seen a few posts about setting focus on your webforms, and I never really had the time to say it... but if you wanna do this, the really easy way is to go grab my free FirstFocus control. poof.
java 1.5 new features

I'm not generally one to really care what java is doing. Nor do I generally chat about stuff I saw on slashdot. However, after reading over the big-new-features for java 1.5, I just wanted to collect my thoughts in one place.

Here's the new stuff in 1.5, and my take on it.

Generics - Provides compile-time type safety for collections and eliminates the drudgery of casting.

While I think that generics are a great feature, and i'm really looking forward to them in .net v2, I think that this is a feature that is against what java was originally designed/marketed for. My understanding is that java was intended as a KISS, OO language/platform. A generics feature is not keeping it simple. It's a powerful, complex feature, and adding it to java seems more like a compromise by the java developers to stop advanced developers from leaving the platform, against the design goals of the platform.

Enhanced for loop - Eliminates the drudgery and error-proneness of iterators.

this is c++'s/vb's/c#'s foreach. I had an interesting talk with a java developer one time where he said that he was disappointed that the c# developers would tie the language to a class-library feature. He thought that wrapping the IEnumerable interface with a language keyword violates some flexibility design goal in the java language. While I like foreach (auto generated code is always nice), and i never had a problem with it myself, I'm wondering what those kinds of java devs think about the change. Is it a Good Thing now that java does it too?

Autoboxing/unboxing - Eliminates the drudgery of manual conversion between primitive types (such as int) and wrapper types (such as Integer).

This is one of those obvious things that i was surprised to find out that java didn't already have.

Typesafe enums - Provides all the well-known benefits of the Typesafe Enum pattern (Effective Java, Item 21) without the verbosity and the error-proneness.

From the sparse article, it looks like java's enums are not only finally there, but are cooler than .net's enums. It looks like the TypeSafe Enums is a shortcut to the "enum class pattern", which, while probably not as performant as a .net enum, is definitely more flexible. In my own .net code, I find myself using the enum class pattern more often than the built-in enum, because it seems I always want to do a bit more than just have a nice name to an int.

Static import - Lets you avoid qualifying static members with class names, without the shortcomings of the Constant Interface antipattern (Effective Java, Item 17).

I'm sorry, but I completely fail to see how this is cool, or even good. What's the big deal about including the classname of the static "constant"? How does it deal with clashing names?

Metadata - Lets you avoid writing boilerplate code, by enabling tools to generate it from annotations in the source code. This leads to a "declarative" programming style where the programmer says what should be done and tools emit the code to do it.

Attributes are a great tool, and it's good to see java didn't snub the feature just because .net was first-to-market with the idea. Hopefully it's as extensible as the .net version. Also, on a purely stylistic level... I like the c# syntax better than the java version, but whatever.

Well there you go. If I've made any glaring errors about knowledge of language history, feel free to let me know. But please, keep the anger and/or elitism to a minimum. I'm no java developer, and I only know enough about the little things in it to generally be able to read the code.

Posted: May 09 2003, 02:38 PM by Andy Smith | with 2 comment(s)
Filed under:
More Posts