Up Periscope

October 29, 2007 14:44

I generally prefer to write posts that reflect action rather than intent. However, given my almost total disengagement from the SubSonic community over the past couple months, I thought it best to acknowledge the situation, and talk a little bit about where I'm focusing my efforts in the coming weeks.

In case you missed Rob's post a few weeks back, as of October 20th, I am now a happily married man (and no, he didn't have to fly to Boston to provide emotional support - no cold feet here). It was a wonderful event, and both Tera and I couldn't be happier with how it turned out. I'll post more about it at a later date, but in the interest of keeping this on target, I'll just mention that SubSonic played a minor, but important role in the process, powering a reservation and reporting system I built to manage to attendance and meal choices for our rehearsal dinner. With the wedding planning, and a perfect storm of professional commitments, which included building another new SubSonic powered site and its associated CMS, I checked out for a while. So to those of you wrote me emails but never heard back, my apologies... Life is just now starting to get back to normal...

So What Now?

While Rob fends off the MVC paparazzi, I'm wrapping myself in my wet blanket and returning to the subterranean depths to work on code with considerably less sex appeal, namely Query 2.0. Specifically, the goal here is to carry forward the simplicity and elegance of the existing model, resolve some long-standing provider neutrality issues, and address some important functional limitations, including adding full JOIN support and mechanisms for specifying condition grouping to address operator precedence issues in WHERE clauses. Once complete, I'll be exploring the extension of the model to support strongly-typed query result sets, providing a richer set of options for operations on complex result sets than simply iterating with IDataReader (no promises yet on this one).

Once the new query engine is in good shape, I'll be revisiting the templates with the goal of providing a significantly improved support for user-generated and extended templates. This has always been a goal of ours, but currently extending templates requires both knowledge and modification of the core code base. We'd like to address this and establish a model which truly supports and encourages the modification and extension of the core template library.

Enough talk for now... It's time for me to get back to actually pumping out some code... As always, your feedback is our primary driver, so please weigh-in with your requests for the next generation query and template functionality!


5 Comments
Actions: E-mail | Permalink | Comment RSSRSS comment feed

"Just Head Down the Hall... They're Right Across from RTFM Technical Writers..."

October 16, 2007 12:28

Foolish, brilliant, or accidental? I'm heading back to the building later this week and may just have to stop in and ask... Edited for contrast/color only...

WTF Consulting 

Real posts (SubSonic and otherwise) will return once the wedding is behind me... Until then, it's strictly visual...


1 Comments
Actions: E-mail | Permalink | Comment RSSRSS comment feed

Freak Orthodox

September 27, 2007 13:34

Sometimes I'm really glad I have camera on my phone... And yes, those are bike flashers on his belt...

Freak Orthodox


4 Comments
Actions: E-mail | Permalink | Comment RSSRSS comment feed

Remedial Query JOINs

September 13, 2007 22:39

Support for SQL JOIN syntax is probably our most requested Query feature addition. As you might imagine, fully supporting JOINs while maintaining the simplicity of the SubSonic query syntax is no small chore.

Rob and I chatted about this late last week, and we both agreed that if SubSonic were to support JOINs, it should do so in a way that makes them easy to work with, and not merely port the SQL syntax into the parser. Personally, I find SQL JOIN syntax convoluted and truly believe that there must a more friendly and readable way to the same ends. In Revision 188, you'll find my first stab at making this happen.

First off, a few caveats:

  • The capability is currently supported only on Sql Server
  • Supplementary syntax (WHERE, ORDER BY) etc. are not supported. If they do actually work, it's only out of pure luck
  • LEFT INNER JOIN support only

Creating a JOINed Query

To facilitate JOIN support, a new Query constructor overload has been added. This overload takes a table schema reference, and one or more table columns as parameters.

Query qry = new Query(Product.Schema, Product.ProductIDColumn, 
Product
.ProductNameColumn, Supplier.CompanyNameColumn, Category.CategoryIDColumn);

 

The column properties represent new static properties in the generated classes, so you'll need to regenerate any existing classes in order to perform these queries. This query syntax ultimately generates the following SQL and result set:

SELECT ProductID, ProductName, [J2].[CompanyName], [J3].[CategoryID] 
FROM [dbo].[Products]
INNER JOIN [Suppliers] J2 ON [Products].[SupplierID] = [J2].[SupplierID]
INNER
JOIN [Categories] J3 ON [Products].[CategoryID] = [J3].[CategoryID]


 

image

So consider this just a first pass, with more to come. As always, we welcome any feedback and ideas, so please add your comments!


14 Comments
Actions: E-mail | Permalink | Comment RSSRSS comment feed

A Tortoise Tip and Hotfix Help

August 20, 2007 13:45

When I posted my Vista rant a few weeks back, I listed "Mysterious file locking" as one of my gripes. However, a recent discovery has lead to believe that the blame for this issue may not rest solely on Vista. In the interest of full disclosure, I should admit that I'm back on Vista (64-bit no less - ouch) for a variety of reasons that I won't go into. Let's just say that I figured every operating system deserves a second chance, and fortunately KB938194 and KB938979 have made the daily grind a little less painful.

Does the following scenario sound familiar? You try to delete a folder, but receive a prompt telling you that "access is denied." Setting security permission and taking ownership of the folder does not help. However, if you delete everything inside it the folder first, you can remove it without problem. With a little help from handle.exe, I discovered that in my case the source of the problem was actually TortoiseSVN, or more specifically TSVNCache.exe, which retaining handles on these folders that I was unable to delete.

By default, TortoiseSVN will attempt to monitor the status of all directories on all drives, adjusting file and folder icons to reflect that current state of versioned files and folders. However, if you attempt to keep any order to your development projects (or even if you don't) the actual paths on your machine that need to be monitored represent only a subset of the overall directory. This means TortoiseSVN is spending a lot of effort (and disk I/O) watching irrelevant directories. Fortunately, there's a simple way to control this which directories TortoiseSVN will monitor. From the TortoiseSVN help file:

"TSVNCache.exe also uses these paths to restrict its scanning. If you want it to look only in particular folders, disable all drive types and include only the folders you specifically want to be scanned."

To make this adjustment, simply open up your TortoiseSVN settings (right click on any folder and select TortoiseSVN > Settings) and select Look and Feel > Icon Overlays.

Your settings will probably look like the following: 

image

To restrict the monitored paths, uncheck Fixed drives and then use the Exclude paths and Include paths values to narrow the scanning. If the specified directories should be acted on recursively, make sure you add a * to the end of the path.

image

Sure enough, once I made this change, the folder locking problem disappeared. Hooray for small victories!

Escape from Hotfix Hell

If you ever had to get a hotfix from Microsoft PSS, you know what a time consuming process it can be. You can spend upwards of half an hour on hold before reaching a screener, and subsequently an engineer, both of whom you'll need to convince that you are indeed to experiencing the problem that the hotfix addresses. So needless to say, I was thrilled when I discovered the following page this morning:

Hotfix Request Web Submission Form

Kudos to Microsoft for finally making it easier to get hotfixes! 


14 Comments
Actions: E-mail | Permalink | Comment RSSRSS comment feed

Needless Verbosity Without Real Information

July 24, 2007 16:17

Exhibit A

image 

Let's break down the pieces of information provided...

  • Link to remedial firewall theory documentation
  • Name of the program (which was knowingly just launched)
  • Publisher of the program (which was knowingly just launched)
  • Path of the program (which was knowingly just launched)
  • Very broad (i.e. Private, Public) destination description
  • Link to a definition of the Vista network location model. No wait, it links to "Choosing a network location"

    and the best one of all:
  • "This program has already been blocked or unblocked for a different network location."

Should I Keep Blocking or Unblock? Well, without knowing where it's trying to connect to it's rather hard to decide.

In fairness, this isn't really a Vista problem. It's an issue that began Windows XP SP2, via the firewall additions and the enhanced Internet Explorer security, which also demands security decisions without providing useful information. However, with Vista UAC, this "Ask, Don't Tell" approach to client security is now threaded throughout the Windows experience.

As annoyed as I am about the lack of useful information here, I can see reasons to attempt to hide the complexity. But why include so much useless information? People don't want to read dialog boxes. And if they're going to spend the time, they should at least come away with information that commiserate with their investment.

image

If software can't inform, it shouldn't pretend to.


3 Comments
Actions: E-mail | Permalink | Comment RSSRSS comment feed

My Apple Saga, Part 1 - Finding my Religion

July 20, 2007 18:26

I've been wanting to write this post for quite some time and today seems as good a day as any. I'm currently in transit from Boston to New York for the weekend on my new favorite form of transportation, the LimoLiner. High speed Internet, power ports, satellite television, big comfortable seats - now I understand why John Madden rides around the country in one of these things. Yeah, it's still a bus, but with a street price of $550,000 it's a damn nice one. Oooh, they're bring around the snacks!

So I bought an iPhone last Sunday. In and of itself, this really wouldn't be that big a deal for me, if it weren't for the fact that it ended my 10 year Apple embargo. And that would also not be a big deal, were it not for the fact that I was once the most insane, stark-raving Apple fanatic to walk the face of this earth. For a period of time I even considered getting an Apple tattoo. Seriously.

This is a story that goes back a good 25 years and covers several stages of my life. My first computer was not an Apple. That distinct honor goes to the Timex-Sinclair ZX-81, a rather nifty device for its time. It featured membrane keys not all that dissimilar to those you would find on the front of a contemporary microwave, which served double-duty as letters and BASIC commands, meaning that "G" was also "GOTO." Like my subsequent machine, the TI-99/4A, any programs you wrote had to be saved on audio cassettes via a tape recorder. I still have a cassette lying on a bookshelf scrawled with names of my earliest programs, each one identified with start and end tape counter numbers so I could locate them to open. The TI-99/4A was a somewhat bulkier beast than the Timex-Sinclair, but still portable enough that I was able to fashion a custom hard-shell carrying case from one of father's old briefcases. But none of these were an Apple II, my childhood ideal of computing perfection.

For most of my childhood my mother worked for our weekly home town newspaper, acting in almost every capacity at some point during her tenure. The paper was a labor of love for those involved, and managed to maintain a consistently high degree quality integrity up until just a couple years ago, when it was sold the media conglomerate responsible for New England's garbage tabloid, The Boston Herald, at which point it became, well what you would suspect given its ownership. In the early days of the Harvard Post, everything was done on CompuGraphics typesetters, massive blue monstrosities offering primitive word processing capabilities and basic archival capabilities via massive 8-inch floppy disks. However, the real strength of these devices was their ability to output high quality type at a before the availability of laser printers through a process that transferred type as photographic projections on to long, narrow rolls of special paper. After being run through some manner of chemical cocktail, these became the individual article columns which were used in the layout of the individual pages sent to the printer in the predawn hours each Thursday morning.

During one of the rare periods of time that the Post found itself with expendable income, someone made the decision to purchase an Apple II, and later for some unknown reason, an Apple III. Perhaps it was lure of VisiCalc, or an overly optimistic belief that this machine could do the same job as the CompuGraphics machine, in a fraction of the space and without the need to dispose of hazard chemicals. This would have been a difficult task for the Apple II, if no other reason than a lack of lower case letters. Whatever the intent, I was the primary, if not sole user of the device, which I dutifully visited each and every afternoon after school until my mother was ready to go home.

apple2

My original dream machine 

 

Software was hard to come by in those days, as the BBS scene was primitive, long distance phone calls expensive, and with 300 baud representing state-of-the-art in communications, file transfers were a maddeningly slow process, even by the standards of the time. But with the built in BASIC capabilities, there was plenty of opportunity to write your own software. Of course, this was a process that required a certain degree planning and linear thinking due to the fact that AppleSoft BASIC lacked a renumber function, resulting in programs that quickly became a mess of GOTO statements.

Eventually, however, someone realized that keeping me entertained was not the most effective use of the paper's resources, and the decision was made to sell the machine. My mother tried to break it to me gently, but despite her best efforts, I still cried myself to sleep that night.

To this day I'm not sure why this machine made an impression on me that other failed to match, but from my first encounter I was Apple obsessed. I don't think my parents quite understood the attachment, especially my father who, attempting to fill the void left by departure of "my" beloved machine was making arrangements to get me my very own DEC Rainbow, only to discover that I was about as interested in this clearly superior piece of hardware as I was in getting a dollhouse. At that point my father finally succumbed and bought me a used Apple II+ with a mountain of floppies loaded with what seemed at the time like every piece of software available. I couldn't have been happier.

If my allegiance ever in question, any and all doubt vanished on the night of January 30th, 1984 when, at 11 years old, I became the original Mac Fanboy.

 

To be continued...


5 Comments
Actions: E-mail | Permalink | Comment RSSRSS comment feed

SubSonic Bits for July 16, 2007

July 16, 2007 13:47

SubSonic on InfoQ

James Vastbinder did a write up on SubSonic for InfoQ. If you've never check out the site before, it's a great news resource tracking the enterprise software development community. Definitely one to add to your bookmarks and/or RSS feeds. Thanks James!

The SubSonic Drive-Through Window

Don Worthley wrote a great post about a reflection technique that can be used to retrieve ActiveRecord objects by name at runtime. Some truly inspired thinking that gets the gears turning and might just makes it into the trunk (with Don's permission, of course). If you haven't had your coffee aren't quite ready to jump into reflection on a Monday morning, I also recommend his insightful post: What is a Software Architect?

iScaffolds

In case anyone out there was wondering, yes, you can use SubSonic scaffolds from an iPhone. It's certainly not the easiest way to update your database content, but in a pinch, it does the job.  


1 Comments
Actions: E-mail | Permalink | Comment RSSRSS comment feed

SubSonic 2.0.3

July 11, 2007 17:32

In the spirit of attempting to make for frequent, incremental releases, the SubSonic team is proud to present SubSonic 2.0.3. Following 2.0.2 by less than three weeks, SubSonic 2.0.3 is primarily a maintenance release, with a few significant enhancements.

What's New and Changed

  • The template execution engine has undergone a complete overhaul with an emphasis on optimizing execution performance, with improvements of up to 800%. If you've used 2.0.2 or earlier, you're definitely going to feel the difference.
  • Three new provider configuration parameters:
    • enableTrace - Allows tracing to be enabled or disabled, addressing certain performance and medium trust issue. Defaults to false.
    • fixDatabaseObjectCasing - Allows case transformations on database objects to be enabled or disabled, preserving the original database casing. Default is true.
    • additionalNamespaces - An optional comma-separated list of namespaces to be added to using/Imports blocks at the top of generated code.
  • The PreUpdate() and PostUpdate() virtual methods in ActiveRecord.Save() have been deprecated and will be removed in the next release. They have been replaced and enhanced with:
    • BeforeValidate() - Executes before any record validation is performed.
    • BeforeInsert() - Executes before the insert command is generated for  new records.
    • BeforeUpdate() - Executes before the update command is generated for existing records.
    • BeforeCommit() - Executes just prior to execution of INSERT/UPDATE command.

Fixes and Work Items

Work Item 9495 - Allow User-Specified Namespace References in Generated Code
Work Item 10237 - StarterSite Default Permissions Allow Administrator Access to All Users
Work Item 10924 - All StarterSite Pages and UserControls Should Inherit from a Single Base Class
Work Item 11228 - ExecuteJoinedDataset Doesn't Fully Qualify Table Reference with Schema Owner
Work Item 11306 - Logical Deletes do not Properly Deal with Null Values
Work Item 11330 - VB Scaffold Templates v. 2.0.2
Work Item 11359 - QuickTable Generates Errors when Used with Views
Work Item 11361 - ODS Controller Templates Generate Code with Logical and Physical Deletes both Marked as Default
Work Item 11370 - BuildProvider doesn't Properly Identify Current Language
Work Item 11379 - VB Classes aren't Generated with Nullable Properties
Work Item 11449 - Scaffold Improvements and Fixes: GUID PK, Hiding ID Column, Fully-qualified Table Names
Work Item 11484 - Column Values not Properly Initialized When Wrapped in TransactionScope
Work Item 11496 - Allow User-Specified Columns to be Hidden in Scaffold Editor
Work Item 11517 - PreUpdate() called too late when saving
Work Item 11557 - QuickTable Does not Prevent Sorting of Large or Binary Data Types
Work Item 11583 - Incorrect Type Mapping in OracleDataProvider for CLOB/NCLOB Data Types
Work Item 11595 - Paged query is not sorted
Work Item 11606 - Sugar.Validation Does not Properly Validate Credit Card Numbers
Work Item 11627 - Non-nullable Reserved Columns Fail Validation
Work Item 11630 - Collection.ToDataTable Does not Set TableName
Work Item 11630 - AbstractRecord TableName Property is Never Set

Download


8 Comments
Actions: E-mail | Permalink | Comment RSSRSS comment feed

Hasta la Vista

July 4, 2007 19:49

I thought my next blog post would be announcing SubSonic 2.0.3 - and until late this morning thing were looking pretty good on that front. I know, it sounds like a lame way to spend the 4th of July, but sometimes real freedom is a quiet phone and an empty inbox. And since our "commander-in-chief" has continued to use the Constitution as toilet paper, I'm not feeling especially patriotic...

But instead of releasing 2.0.3, I'm rebuilding my dev box. For reasons I will probably never know, IIS decided to take a permanent holiday this morning and no amount of coaxing would bring it back. I attempted to remove and reinstall IIS, only to discover that once removed, it had no intention of going back. Fair enough, I'll do a repair install of the OS, just like I used to do when XP became completely FUBAR.

Well, in Vista you can't do that anymore. There is simply no option to reinstall core OS files short of a full reinstall. Ok then, I guess this means a full reinstall - it'll give me a chance to truly clean house. Well, during one of the many reboots in the process, the boot manager decided it was time to reshuffle my drive letters, turning my C:\ drive into my E:\ drive, an in so, refusing to boot back into the installer. Oh joy.

So I thought for a minute about what Vista has really done for me in the three months since I made a full commitment to it, and whether I really felt like fighting it anymore:

Positive Vista Contributions

  • Nice eye candy
  • A better task scheduler
  • A services tab in task manager
  • None of the features (like WinFS) that got me initially excited about it.
  • Ability to run Halo 2.

Negative Vista Contributions

  • Significantly slower file operations everywhere
  • Mysterious file locking
  • A complete lack of transparency into the inner workings of just about everything on my machine
  • Beta quality video drivers six months after official release. Thanks nVidia!
  • Bonus: Despite repeated to attempts to convince it otherwise, thinks every folder contains pictures thereby removing any useful information and replacing it with a slide show option. Surprisingly, .dll files don't render into nice 24-bit images.

And there it was: A choice as clear as daylight. Of course, thanks to the symbolic links that Vista creates across the file system as part of the virtualization model, this is not a straightforward process.  Windows XP cannot delete the contents of the Windows directory, and you won't even make it to the initial reboot without a file copy failure. In retrospect, I probably should have just blown away my C:\ partition, but I chose the difficult route, which involved Ultimate Boot Disc and the manual resetting of permissions and ownership across several directories. But now I'm on my way, XP is installed, and I've commenced the laborious process of reinstalling all the applications I depend on.

It's funny - I don't feel like I've given up a damn thing. In fact, I'm actually excited to be back on XP - back to a fast, tried-and-true operating system that I control, without daily surprises. Goodbye Vista - I've got work to do and I don't have time for this bullshit. You're beautiful, but that's enough to sustain a relationship. Call me when you hit SP1.


18 Comments
Actions: E-mail | Permalink | Comment RSSRSS comment feed