Geodatabase Kung-Fu: Geo-Business Objects

Posted by Dave Bouwman | Posted in .NET, ArcGIS Devt, Devt Tools, ESRI | Posted on 26-07-2006

2

Jeff Germain and I have been doing some cool work with the geodatabase, and I’m going to summarize our work over a series of postings. This post introduces the key ideas…

Standard “Business Objects”
In keeping with object-oriented design, most applications are now utilizing classes (business objects) to represent the real-world entities of concern to the application. When it comes time to store these entities in a database, the data access operations are typically bundled into the business objects themselves, or in associated helper classes. The advantages of this model are many, including:

  • cleaner code design
  • easier maintenance
  • encapsulation of data storage logic
  • single point for database schema changes
  • with .NET 2.0, object data binding is possible (very cool)

There are many design options which take this model to various levels of complexity. You can find all sorts of information about Object Relational Mapping at ORMappers.com

Geo “Business Objects”

Since this is such a nice design pattern, we wanted apply the same logic to the geodatabase. Afterall, you design classes when you design a geodatabase, but the geodatabase API is cumbersome as compared to working with standard business objects. 

To be clear – we’re not talking about replacing IFeature and IRow, after all, you still need to talk to the geodatabase, and that’s how ArcObjects works. But, in order to avoid working with the geodatabase API all over our code, we designed wrapper classes that hide the ArcObjects code behind a nice “business object” facade.

Some might ask – why would you go to all this trouble? The first part is that for large enterprise systems, where they may be 10 or more associated attribute tables related to one feature class, being able to work with a set of business objects greatly simplifies creation of attribute editing forms. And, if designed correctly, these objects could be used in Desktop, Engine and Server applications. The second part is that once you set it up, it’s not much work. Which brings us to…

Code Generation
A nice thing about business objects is that they follow a pattern. And computers can do great things with patterns – like write the code for us. This is what code generation tools bring to the table. A typical code generation tool connects to the database, reads the schema, and creates classes based on code templates. This process takes a few seconds, and can be re-run at any time, and many teams add this as a step in their build process. Depending on the templates used, there are options where the developer can add custom logic which is not over-written when the code is re-generated (via inheritance or partial classes). As you may have guessed, this results in massive time savings when writing applications.

For example, I needed to create an application to edit the tables in a standard relational database (Process table shown above). Using RapTier, I was able to create a complete data access layer in a few minutes. Once that part was done, I was able to very rapidly wire the business objects into an interface, and the application was complete. The image below shows the classes created for the “Process” table. You’ll notice that these objects do not have “Get”, “Save” or “Update” methods. In the abstration model used by RapTier, all these functions for all the classes in the database are in a single helper class.

But this is a Geodatabase…
So, this works well for traditional RDBMS tables, but it’s not going to fly for the geodatabase. First off, you can’t infer all the details of a geodatabase model directly from database schema itself. Specifically, you’d miss thinks like relationships, domains and subtypes. Additionally, if you are working aginst ArcSDE you’ll get all those pesky A, D, F, and S tables. Finally, the code that would be generated would use standard SQL (or stored procs) to insert and update the data. So, clearly we had some issues to work out.

Our Process
We’ve got two large projects on the go right now, and both are going to be subject to many geodatabase schema changes over their life span. To that end, we are working on a process where by we are able to generate business objects (and class extensions) directly from a geodatabase. The diagram below shows how this works, but the high-level steps are as follows:

  1. Export the geodatabase schema as Xml
  2. Transform that into a simplified Xml
  3. Use this simple Xml to generate the code
  4. Use object data binding in .NET 2.0 to simplify the form wiring
  5. Repeat when the schema changes

In the next installment, I’ll review the process, the business object templates we’ve created and tools we’ve used to so this.

Conversations Redux

Posted by Dave Bouwman | Posted in Blogging | Posted on 13-07-2006

3

Glad to see that this topic generated some thought, comments and “conversations” around the GIS blogs.

For me, I’m somewhat suprised that GIS people have not jumped on blogs as much as the developer community. In many ways the two are similar – many people are asked to accomplish complex tasks, with many dynamic variables to the problem, typically working in smaller groups or individually. Since I straddle both communities, and I get so much value from the .NET blogs, it is interesting that this has not been widely adopted in the GIS arena.

From the comments and other blog postings, I think that those who are blogging on GIS should make an effort to not only bring more people into blog / rss / aggregator awareness, but to suggest that people start their own blogs so we have wider diversity. In addition, we should compose posts such that they invite conversation. I’ll be trying these approaches, but for those going to the ESRI user conference – try encouraging people to jump into blogging. There are soooo many places where people can start blogs for free, so there is very little barrier to entry, and so much value to be gained – both at an individual level with How-To… and How-Do-You type posts, and as a community with wider participation in the larger conversation.

re: posting in the future – this is just a bit of fat fingers – I’m at a client site this week, and I’m not too great with the track pad on my notebook!

also – I tried to post this comment over at AllPoints, but I’m on an open wireless connection and the IP has apparently been used to spam in the past so I was denied, so I posted it here…

Comment to AllPoints Posting – Chiming in on the Conversation

Hello Adena!

I’m out at a client site this week and I’ve been asking around about blogs in general, and GIS blogs in particular. And it for the most part, GIS people are just beind the adoption curve. Heck – I think that general internet users have yet to really grok blog / RSS / aggregation etc.

I think the main reason I asked the question was that I get so much value out of conversations on niche blogs related to non-GIS development, that I would expect that the relatively niche area of GIS would latch onto this same technology. In both cases, blogging and rss helps bridge gaps between relatively isolated individuals working on complex problems, so it would seem to be a great match up. Maybe we’ll see wider awareness and adoption as ESRI puts more effort into blogging.

Cheers,

Dave

GIS Blogs: Where’s the conversation?

Posted by Dave Bouwman | Posted in Blogging | Posted on 12-07-2006

10

I’ve read Robert Scoble’s blog
for a long time, and regardless of your opinion of him, he does have some
insights about blogs and their role in the formation of communities. In his
work, you read a lot about “conversations” and how blogs can facilitate the
conversation with and within a community.

What I’ve noticed is that this
is not really happening on the GIS blogs. The only place you’ll see anything
akin to a conversation is on James
Fee’s blog
, and then it’s only when he rips on ESRI, and a bunch of other
people thrown in a “me to!” or “you tell ‘em!”.

I’ve been thinking about
this for a while now… and I have come up with two possibilities (I’d love to
hear others)

Its a Numbers Thing:
Do the other hot blogging
areas (i.e. politics and software development) simply have so many more people
involved that they can attain a critical mass, from which a sort of
decentralized meta-community occurs? The problem I have with this is that there
are 1000’s and 1000’s of people who use spatial technologies, so even a small
percentage should result in more bloggers and readers (who, I’d assume would be
commenters – thus the conversation!). But this just does not seem to be the
case. Which leads to…

Technical Savvy
Is the GIS community at
large simply not technically savvy enough to be “into” blogs in a large way?
Some readers may get a little bent by this characterization – after all, we do
“computer mapping”, which requires us to be technically inclined. Right? Back
when you had to know how to grep your file system to locate that bash script you
wrote to automate mounting and unmounting drives while running a set of kriging
amls – yes – you had to have a certain level of savvy. But, with ArcMap and the
draggy-droppy-love-fest that is model builder, I think we can agree that the bar
has been lowered. Perhaps this is translating into people who don’t “google” a
problem, and who would never find a blog, let alone comment on a post, or start
their own blog. Maybe with IE7, the wide adoption of RSS through Office 12
and Windows Vista we’ll see this change, but for now I think it’s just the
alpha-geeks… and apparently we don’t like to talk with eachother – more just talking (or posting) at eachother.

Anyhow – I just thought this was interesting, but what are your thoughts? Would having the conversations matter?
Are the ESRI (and other) forums enough? Is blogging to arcane for the GIS masses? When will it hit the tipping point?

SlashGeo: Link Blogging with Value

Posted by Dave Bouwman | Posted in Blogging | Posted on 11-07-2006

1

Preface – I’ve been really busy lately, and am just catching up on the my blog
reading while flying out to the East Coast. Thanks to RSSBandit and w.Bloggar offline reading and
posting works pretty smoothly.

So – Slashgeo gets 1,000,000 hits. woo. DrkSide
has a great point
- how does this matter? What value has been added? GISDirtbag points out what I’ve
always thought – SlashGeo is mainly forwarding other posts. On top of that, they
are mostly from Directions, which is 50% forwarding other posts, and 50% press
releases! If this was email, SlashGeo would be the well meaning friend /
relative that forwards “cute” junk mail. It’s not nefarious, but it also adds
little to the conversation.

The purpose of this post is not to simply
rail on the SlashGeo
“Team” (mentioned in this post)
, since that is not actually adding anything
to the conversation.

Rather I have a suggestion as to how they can add value: If
you are not adding content, then add value by acting as a filter. Here’s a litte
background on how some others are doing this in the .NET world…

In order to
stay on top of what’s going in in the larger .NET world, I read a lot of blogs
(via RSS). I just recently culled my feed list down to 60, but many of these are
now aggregate feeds – representing 10’s or 100’s of bloggers each. Anyhow, this
represents a LOT of traffic – 100’s of posts a day. As I noted above, I’m pretty
busy, so finding time to read 150 posts a day is not easy.To make this easier, I
have found some really good blogs which act as filters – separating the good
stuff from the background “noise”.

Perhaps the best example of this is Jason Haley’s “Interesting Finds”.
Basically Jason subscribes to 1000+ feeds, and twice a day sifts through them to
find the gems.

 

He even notes the “signal to
noise ratio” – how many posts he reviewed vs the number that were
“interesting”.

When I do have time to read all the incoming feeds, I
consistenly find that when I get to Jason’s posting, the things he has picked
out, are the postings I actually read. So – most days (or when I’ve got time)
I’ll start by checking what he’s filtered out, and actually reading the posts,
rather than spending that same time weeding through the same list of
“noise”

Slash et al: You seem eager to add something to the community & “conversation”, and this could add value. Parse out everything
from PlanetGS/ESRI feeds/.NET feeds etc, and list only the interesting stuff. Of
course, interesting is in the eye of the beholder, but it’s a start. Maybe your
team could specialize – ESRI Developer stuff, Open Source Stuff, End User Stuff,
Data Stuff, Google Stuff.

Just an idea, because just sending quotes and links is
not adding much to the conversation.