This question is locked. New answers and comments are not allowed.
I'm currently converting a large old project from the classic model to the newest utility build.
Well, you used partial classes. As the Genome developers did many years ago...
It is a nice looking solution. And it was working fine so far I was converting rather simple classes.
But now I'm working on a complex class. And I have an issue.
There are to many lines of code in the persistent property setters.
How can I reprogram this in the new model?
I have just two ideas:
1. Make a wrapper class of the persistent class.
2. 'Wrap' the complex property. So, I will specify on the diagram it as AutoGenerated_ContactType with the access modifier as as private.
And will just manually wrap the persistent field with all required logic in the setter.
The (1) is as written in the books solution. :-) But it is too much handmade simple code to wrap every property, even trivial property.
The (2) is acceptable but the fake properties looks ugly in the designer.
Well, the Rational Rose had special sections on the diagram to specify the user's code. You were able to change it in the code editor, because the sections were protected with pre-compiler sings, so the generator didn't change it. It is a rather unwieldy solution though...
Do you know any better method? Maybe with an inheritance? I can't understand how to use it?
I can see the generated properties as virtual...
How did you imagined to use it?
Thank you, thank you.
Well, you used partial classes. As the Genome developers did many years ago...
It is a nice looking solution. And it was working fine so far I was converting rather simple classes.
But now I'm working on a complex class. And I have an issue.
There are to many lines of code in the persistent property setters.
How can I reprogram this in the new model?
I have just two ideas:
1. Make a wrapper class of the persistent class.
2. 'Wrap' the complex property. So, I will specify on the diagram it as AutoGenerated_ContactType with the access modifier as as private.
And will just manually wrap the persistent field with all required logic in the setter.
The (1) is as written in the books solution. :-) But it is too much handmade simple code to wrap every property, even trivial property.
The (2) is acceptable but the fake properties looks ugly in the designer.
Well, the Rational Rose had special sections on the diagram to specify the user's code. You were able to change it in the code editor, because the sections were protected with pre-compiler sings, so the generator didn't change it. It is a rather unwieldy solution though...
Do you know any better method? Maybe with an inheritance? I can't understand how to use it?
I can see the generated properties as virtual...
How did you imagined to use it?
Thank you, thank you.