Getter / Setter code

Hello

I’m evaluating VP so sorry if this is too basic.
I need to implement logic in some attribute’s setter / getter of the class, how could I do that?
My target lang is c#.

Thanks in advance.
Martin

Hi Martin,

Thanks for your post. We are sorry that we do not support entering implementation of setter/getter in application.
But would you mind to tell me how do you generate the code (Instant Generator, round-trip engineering or Object-Relational Mapping (ORM))?

Best regards,
Lilian Wong

Hi Lilian

Thanks for your soon answer.

I’ll tell you the steps I did, maybe it’s not the right

I began from ORM reverse database, from an I5 I recovered a db creating classes as well.
After that I set up setters and getters and with Instant Generator could previewed code.

I didn’t use round trip because only saw Java round trp option.

Thanks in advance.
Martin

Hi Martin,

Thanks for replying. May I know why do you need to specify logic in setter/getter? What you would like to do?

By the way, I would like to let you know that ORM, Instant Generator (or Instant Reverse) and round-trip engineering re different features so we do not recommend users mixed use of these feature.

Best regards,
Lilian Wong

Hello Lilian

Thanks for your interest.
Actually what I mainly need is too add in setter validation, calculation and translation.

It would be performet through helper methods so, if could call a function passing some attribute’s properties it would be fine.
For example:

validate(attribute_regex_property)
or
translate(status_value)

If it wouldn’t be possible to use round trip at least I would want that changes at model level applies after execute code generation in the application classes.

Thanks in advance
Martin

Hi Martin,

Thanks for replying. The generated ORM code is persistent layer (model), it’s better to include as less logic as possible since they should be very stable, and business logic are built on top of them.

Best regards,
Lilian Wong