On Sat, Jan 8, 2011 at 1:07 PM, Martin Makundi <martin.maku...@koodaripalvelut.com> wrote: > > What I hate about java is its one-dimensionality... ehh.. say you have: > > object man > object man carrying bag > bag carrying pencil case. > > Now I want the man to hand me the pencil, I must implement: > * man.getpencil->man.getbag.getpencil > * bag.getpencil->bag.getpencilcase.getpencil > * pencilcase.getpencil > > In real business cases this is very OK, but usually there are 90% just > dummy getters and 10% are real business objects like "transfer money > in avery safe and robust manner"... > > I whish there was an easy way to "transparently penetrate beans". I > could actually call man.getPencil and it would be authorized to fetch > it from bag,pencilcase. > > Ofcourse I could configure exceptions to the rule, but in general I > could say that "it is allowed in general" or "it is not allowed in > general". And maybe annotate access rules. >
This isn't a Java problem. This is a design problem.