Sourcecode in Geodatabase Prototype

I’ve written a proof of concept editor extension based on the ideas outlined in my previous post, plus some helpful feedback from Brian Flood (thanks!).

The solution, which includes an installer and test file gdb, has been uploaded to arcscripts, right here.

The editor extension maintains a generic List of IExtensions. The extensions in this list are instantiated at OnStartEditing from source code in a table called SourceCode in the edit workspace.

There is also a command provided on a commandbar that allows you to browse and load a source .cs file into the SourceCode table, after verifying that it compiles without errors.

Note that the “using” statements need to include a full path name to the assembly files referenced by the source code.

I’m wondering if this approach might be easier than class extensions as well as easier to maintain. I haven’t tried it, but I suppose it would be possible to have it work with shapefiles as well.

The potential uses of dynamic compilation are intriguing. I’d really like to try this in a IServerObjectExtension. More on that later.

Advertisements

6 comments so far

  1. Dave on

    Kirk,

    Instead of throwing source code into ArcScripts, why not use Assembla? It’s free subversion hosting, and you control committer access. We’re actually using it for some production projects b/c it’s just easier than setting up our own SVN box. Just an idea…

    Dave

  2. Kirk on

    Hey Dave,

    Wow, I never realized Assembla offers so much, and free too … very nice. I’ll upload it there next iteration.

    Thanks!
    Kirk

  3. Brian Flood on

    great stuff kirk, I like the idea of a VS plugin to publish the source code directly to the DB. you could also just use a network file manifest and source location for all those who do not have a DB

    dave – hows Assembla work with VS.NEt? any issues?

  4. Kirk on

    Hi Brian –
    Funny you should ask about VS. My VS started crashing frequently last week when it completes a build (even after a clean). I suspect the problem is with ankhSvn add-in, but it’s hard to say. When I go into Tools>Addin manager and uncheck it I still see everything, and next time I open the solution it is checked again.

    AnkhSVN sits on top of TortoiseSVN, which is a shell extension, integrated into Windows explorer. I just now upgraded tortoisesvn from 1.4.6 to 1.4.7 … hasn’t crashed after the first few builds. If there’s some other approach to working with SVN in VS I’d love to hear about it.

    Incidentally, I downloaded VS2008 just to see if it crashes when I build the same solution, but the Express version does not support multitargeting.

  5. Paolo on

    Kirk
    I was using AnkhSVN 1 year ago for some months, and then I removed it as far it is very unstable. But maybe now they have improved.
    Just use Tortoise or the command line 😉
    ciao!

  6. […] Posted June 23, 2008 Filed under: Uncategorized | Based on initial investigations of storing source code in the database, I’m now focusing on storing assemblies in the database, serialized as blobs. Doesn’t […]


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: