Say, I have some system and a method in it declared as such:
protected cmpA doSmthg(cmpA a)
cmpA newA = a;
newA = a.setFieldA(...); // constructor 1 of cmpA
newA = a.setFieldB(...); // constructor 2 of cmpA
then is update():
cmpA myA = doSmthg( ed.getComponent(e.getId(), cmpA.class) );
will it work this way?
Probably a dumb question, but well… 12 hours of coding today
Sure… I don’t see any reason it won’t work.
A couple style issues:
- for my own stuff, I adopt the changeA(), changeB() style conventions because they don’t get confused with classic setters.
- if you find that you set A and B a lot together then you can save a little garbage by having a changeAB(A, B) method… since you avoid the extra unnecessary temp object that way.
Ok, thanks! I’ll be sleeping better knowing at least I’ll start seeking elsewhere n code tomorrow
Are you actually seeing an issue? Perhaps that’s a better place to start.
disregard this, I believe I know what the issue is.