Author Topic: customize code engineering?  (Read 20526 times)

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8604
  • Karma: +256/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: customize code engineering?
« Reply #15 on: March 28, 2006, 08:25:52 pm »
Quote
;) Oh, so   t h a t ' s  why it wont compile  ;)
b
Did you like my new word for the day?

Procrustean      ;)

I saw it in another publication, looked it up, and it was so apposite I was able to use it in the response not half an hour later!  - Fate!    8)

Paolo
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!

gtschech

  • EA Novice
  • *
  • Posts: 14
  • Karma: +0/-0
    • View Profile
Re: customize code engineering?
« Reply #16 on: March 28, 2006, 10:47:19 pm »
bruce & paolo,

I totally agree wiht you that naming standards by themselves do not enforce any quality of code.
In my case the development team has discussed a lot of naming standards (casing, prefixing, naming) and yes, we had some requirements.
Briefly spoken, it's just 2 of them
a) the code must be readable -> variable names should primarily reflect their content or primary use, not their data type or things like that
b) the names should be optimized for IntelliSense, for since I work with VisualStudio.NET, I can't remember having typed a single variable name to it's end before hitting "tab" for autocomplete-ing  :)

Both requirements led us to - as I think - reasonable guidelines.
But one of them is that we feel it should be immediately visible if a variable is a local variable or a class-level variable. Of course, we could have agreed on adding "this.", but isn't that another kind of prefix? (and besides that, it's much longer than "m_"...).
So the coding guys are all satisified, and the only problem is the model.
Even here all participants have the same understanding that coding-specific prefixes should not be visible in the model, so up comes my problem...

Guenter
« Last Edit: March 28, 2006, 10:48:21 pm by gtschech »

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8604
  • Karma: +256/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: customize code engineering?
« Reply #17 on: March 29, 2006, 12:07:48 am »
Guenter,

The problem occurs because your Class model in EA doesn't reflect your Class model in code.

I agree that the adornments shouldn't be seen in the model - at the conceptual and logical levels (whatever they mean - I know, but do you have the same understanding? ;-) ).  Let's call these Non-Platform-Specific-Models.  However, at the PSM level it seems to me essential that the two class models are identical, as far as is possible).

Remember, I'm not a big fan yet of Round-Trip-Engineering (see my postings elsewhere).  However IF you ARE going to attempt it, the two models should be as identical as you can make them.

It seems to me that you need to have two models: the CIM and/or PIM models - which don't have adornments and the PSM that you use to generate and synchronize code with.  You need a transformer to go from the PSM and back.

Fortunately, EA has such beasts.

Your transformation would add any appropriate adornments and changes (often caused by "impedance mismatch" between the PIM and PSM) between the two models.

HTH,
Paolo
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!

gtschech

  • EA Novice
  • *
  • Posts: 14
  • Karma: +0/-0
    • View Profile
Re: customize code engineering?
« Reply #18 on: March 29, 2006, 04:01:18 am »
Hi paolo,

now there are those acronyms I wanted to avoid  ;)

I am not sure whether my project deadline will allow me to dig into the PIM/PSM transforming stuff.
From my experiences with EA roundtrip engineering (some years ago I used V4, now V6 for about 3 months) I believe it can be done, but haven't looked into it yet.

It seems like I'm going to live with my adornments in the model and keep the beautifying (i.e. separation of PIM and PSM as well asl round-tripping) to a later project step.

Nevertheless: I'd be glad if you could point me to some helpful discussion of the transformation process (some good keywords for the forum serarch would do nicely, thank you :) )

guenter

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: customize code engineering?
« Reply #19 on: March 29, 2006, 06:41:43 am »
Perhaps another 0.01 CAD worth, to add to the other one I threw in earlier.

Meanwhile I'll remind you of what I said earlier. If you are going to have two levels of abstraction - regardless of how close or far they are from each other - you need to have two presentations within your model.

You mention that prefixes should not be visible in the model. However, you want clear, readable code. I will stick my neck out here and guess that you also want the code to compile as you specify.

I am going to stay well away from the methodology stuff here. I do strongly agree with what is being said there, but you are in the middle of something, and research, selection, adoption, and implementation of a methodology might, within the scope of your current project, negatively affect your critical path.

If you want some portion of your model to accurately map to the code you will need, at least in this model portion, to have the prefixes, or whatever, show up in the model.

[b[If[/b] you want some portion of the model to allow (some of) your audience to review the 'pure' structure without adornments, you will need, at least in support of this model portion, to conceive a mapping between the 'pure' structure and what is in the portion of the model that directly reflects the physical system.

That mapping can be realized in a transform. In your case it, as you describe your needs, this would seem to be very limited in scope and complexity. If the overall size of your model is not too tiny, then this could well pay off immediately, since you can keep the two portions in synch, and may even be able to model one 'side' and generate the other through the transform. If your model is small, then this step will probably be quite quick, and could fit within your schedule - possibly offset by reduced time needed for hair-pulling.

You could even model the components of the transformation itself, giving you a way to examine your 'in-house standards' as well as publishing the expected results, audiences, and benefits. Who knows, your various communities might actually come up with a set they could all work with...

David
No, you can't have it!

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8604
  • Karma: +256/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: customize code engineering?
« Reply #20 on: March 29, 2006, 06:49:23 am »
Guenter,

The only thing I can add to David's (excellent) comments is that if you really can't afford 2 presentations at this time, then the one to go for now is the PSM - code and model align.  Later you can create the more "presentable" version, via the transforms.

In a sense, this conforms to the Agile adage:  "Prefer working code to documentation".

Paolo
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: customize code engineering?
« Reply #21 on: March 29, 2006, 07:09:31 am »
Or more to the point, if the code won't compile, then the management presentation can be deferred. When it comes time to explain which half you concentrated the limited resources on, much will be forgiven if the code works.
No, you can't have it!

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8604
  • Karma: +256/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: customize code engineering?
« Reply #22 on: March 30, 2006, 06:52:57 pm »
Quote
...
Nevertheless: I'd be glad if you could point me to some helpful discussion of the transformation process (some good keywords for the forum serarch would do nicely, thank you :) )

guenter
Guenter,
I'm currently not using EA (in anger - I'm on a different project where a different DB modelling tool is used)

I've also not yet got into the tranformation processes in EA as much as I'd like, so I won't be much help with keywords.  However, I'm sure you can check it out yourself.

Paolo
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!

thomaskilian

  • Guest
Re: customize code engineering?
« Reply #23 on: April 01, 2006, 12:25:11 pm »
Quote
Hi paolo,

now there are those acronyms I wanted to avoid  ;)

I am not sure whether my project deadline will allow me to dig into the PIM/PSM transforming stuff.
From my experiences with EA roundtrip engineering (some years ago I used V4, now V6 for about 3 months) I believe it can be done, but haven't looked into it yet.

It seems like I'm going to live with my adornments in the model and keep the beautifying (i.e. separation of PIM and PSM as well asl round-tripping) to a later project step.

Nevertheless: I'd be glad if you could point me to some helpful discussion of the transformation process (some good keywords for the forum serarch would do nicely, thank you :) )

guenter

Hi Guenter, I currently have some spare time and also work with Transformation. So you might give me a ping and we even could discuss this a bit by phone. (I'm located in greater Berlin area)


Edit:Btw: Naming conventions? Why aren't you talking about indentation?  ;D
« Last Edit: April 01, 2006, 12:26:21 pm by thomaskilian »

SF_lt

  • EA User
  • **
  • Posts: 216
  • Karma: +1/-0
  • The Truth Is Out There
    • View Profile
Re: customize code engineering?
« Reply #24 on: April 03, 2006, 03:49:09 am »

Paolo, could you share with us your adopted naming conventions?
registertm everything to SparX

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8604
  • Karma: +256/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: customize code engineering?
« Reply #25 on: April 03, 2006, 06:44:23 am »
Quote
Paolo, could you share with us your adopted naming conventions?
Well SF_lt,

I did observe that everyone's situation is different and so I would be, to some extent, going against my own admonition to do that.  However, I can discuss some of the principles I have adduced and have helped me in arriving at my conventions.  I'm sure I'll learn something in the discussions and it will help me improve my own standards.

If this is agreeable, I can start up some separate threads (say in the UML forum - since that seems to be the most appropriate), each one dealing with some aspect of naming.

I think this would give readers the best "bang for the buck".

Let me know if anyone is interested...

HTH,
Paolo
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!

SF_lt

  • EA User
  • **
  • Posts: 216
  • Karma: +1/-0
  • The Truth Is Out There
    • View Profile
Re: customize code engineering?
« Reply #26 on: April 03, 2006, 08:12:33 am »

of course, count me in  ;D
registertm everything to SparX

gtschech

  • EA Novice
  • *
  • Posts: 14
  • Karma: +0/-0
    • View Profile
Re: customize code engineering?
« Reply #27 on: April 03, 2006, 08:13:36 am »
Me 2

Guenter

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: customize code engineering?
« Reply #28 on: April 03, 2006, 10:21:06 am »
And I.
No, you can't have it!

Bruno.Cossi

  • EA User
  • **
  • Posts: 803
  • Karma: +0/-0
    • View Profile
Re: customize code engineering?
« Reply #29 on: April 03, 2006, 10:25:15 am »
Me too