Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

OK - I understand that this is a bit subjective - but you're the best community forum I've got!

So, we are talking about starting a fresh customisation for ArcGIS or a Windows app using Engine. I often become a little perplexed when trying to create nice clean layers of abstraction between my GUI, business objects and data access layer (geodatabase access).

It often works out like something below:

enter image description here

  • The PresentationLayer makes calls in BusinessLayer to get data from database and give back wrapped up in some form of business object - it is never a ValueObject straight fresh from the database.
  • In BusinessLayer - I have all my business logic that accesses DataLayer for data from the geodatabase (it gets back data from the geodatabase via ValueObjects - DataLayer also uses this assembly).
  • In ValueObjects assembly, this is just a set of objects that map directly to SDE tables and do nothing else.
  • Core is where the program starts and shows forms etc.
  • Common is just a place to put things that are useful to use here and there, usually static methods etc.

Does this look sane? How do you structure your solutions?

share|improve this question
add comment

2 Answers 2

I like very much to talk about ArcObjects and that kind of discussion, but people may not find it suitable here.

Well I always have a project for specific, ArcObjects code only. That means I can reuse these methods and classes anywhere else. (sounds like your Common).

This is how I do it:

  • Solution

    • Business Project

      • Models (this is how I name the mapping between features and objects);

      • Repositories

      • Other business code

    • Business Test Project

    • AO Specific Code (I generally call it Company.Project.GIS and it divide it following the main namespaces ESRI has. This project cannot ever never reference the Business Project. If you need to build a geometry aggregator, or a tool that works commonly, build it here, and consume it on the business layer)

      • esriSystem

      • Carto

      • Display

      • Geodatabase

      • Geometry

      • Authentication (this is a custom part, that handles, for example, authentication against a table in a geodatabase - but it could be anything else);

    • AO Specific Code Test Project

    • UI Project

      • Forms

      • Controls

      • Extension

      • Commands

      • Tools

      • Dockables

      • etc

    • UI Test Project

I try to separate UI project from Business Project, but sometimes with legacy code you can't just bring them apart and I always create separate projects for unit testing.

share|improve this answer
    
+1 for "Well I always have a project for specific, ArcObjects code only." we also isolate AO code into a common assembly so all developers can use the functionality without having to use or import AO assemblys into their projects. But we also allow the developer to use AO for specific functionality in some solutions as long as the project are named properly so we easily can find the projects that need to be updated when we get a new version of AGE. –  MathiasWestin Sep 2 '11 at 7:00
add comment

Dave Bouwman wrote a helpful series 5 yrs ago about this. I would be very interested in hearing how his methodology has evolved since then.

Geodatabase Kung-Fu: Geo-Business Objects

Code Generation + Geodatabase = Goodness

.NET Databinding the Geodatabase

share|improve this answer
    
Cheers Kirk - will check this out - think I have looked at it in the past but probably worth another look. –  Vidar Sep 1 '11 at 20:41
    
I have also seen this: edndoc.esri.com/arcobjects/9.2/NET/… - Don't know whether you have ever tinkered with this approach? –  Vidar Sep 6 '11 at 14:25
    
I played a couple of yrs ago with inheriting from BindingList, but I don't think I used this sample. Where it gets messy is when you need to deal with subtyped featureclasses where you want the UI to display choices for particular field where the field has different domains depending on the subtype. –  Kirk Kuykendall Sep 6 '11 at 16:39
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.