• Post Reply Bookmark Topic Watch Topic
  • New Topic

Way to report on field mappings in multi-layered architecture  RSS feed

 
Nick Kelly
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I haven't posted here in a while - hopefully this is the right forum and one of you smart and kind people can help me with this problem or point me in the right direction.

I want to be able to extract the field mappings from a multi-layered architecture so it can be displayed in a straightforward way to non-IT people.

So for example, if I have a few classes like:

MyScreen with attribute A
MyDomain with attribute B
MyDB with attribute C
MyAssembler with a method that does something like MyDomain.setB(MyScreen.getA())
MyMapper with a method that does something like MyDB.setC(MyDomain.getB())

Then I want to be able to output something like:
MyScreen.A -> MyDomain.B -> MyDB.C
So it is straightforward to determine e.g. what database field an element on the screen corresponds to.

The real problem is more complicated than this (lots more layers, classes, fields, mappers, conditional logic etc.) but if you could give me an idea of something that could make a start at this it would be a great help.

Thanks!
 
Steve Luke
Bartender
Posts: 4181
22
IntelliJ IDE Java Python
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are you looking for a UML diagram as a result? If so, I think there are Java -> UML reverse generation tools, AgileJ is one, I think. There are probably others.
 
Nick Kelly
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the reply Steve.

I had originally thought of something like a sequence diagram but unfortunately I don't think it would make much sense to our business users as well as being overly complex and requiring a lot of work to generate (I need to map around 150 fields through about 5 layers).

What I'd ideally like to end up with is a list of fields (e.g. on a screen or an external call) and their corresponding fields in the database.

For example:
MyScreen.A, MyDomain.B, MyDB.C
MyScreen.X, MyDomain.Y, MyDB.Z

So it is straightforward to see that field A on the screen is field C in the DB and field X on the screen is field Z in the DB.
[ November 06, 2008: Message edited by: Nick Kelly ]
 
Martijn Verburg
author
Bartender
Posts: 3275
5
Eclipse IDE Java Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Nick,

I'm not 100% sure how you could programatically go about this (since you state you have many layers of abstraction). Unfortunately it might have to be a manual job (perhaps kept in a Spreadsheet).

Are their naming stds/conventions that have been adopted that might assist?
 
Nick Kelly
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the reply Martijn - I was afraid you'd say that!

Yes we have a large spreadsheet with the data mappings but it is from a while ago and so the feeling is that it is out of date and unreliable.

Someone could spend a couple of weeks to try and manually recreate it but this would be an error-prone process and even then it would soon become out of date again.

We've given some thought to doing this with annotations or graphing classes but without much luck. As you say, this would depend on naming standards or conventions which aren't really there at the minute and I don't want to start rewriting the code without a clear idea of where I'm going.
 
Martijn Verburg
author
Bartender
Posts: 3275
5
Eclipse IDE Java Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Nick,

It's a vexing problem indeed! Unfortunately the only way I've found to tackle similar problems was to use UML reverse engineering (and hope that the relationships between classes were fairly intact/easy to understand).

Sorry I couldn't help any further!
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!