Re: Java type-casting -- Q3
grz01 wrote:
Plus saves you from bloating your code with yet another
<flame-warning>silly</flame-warning> JavaBean class :)
markspace wrote:
You seem to have a real thing about Java Beans. I don't use them much,
so I can't speak about their architecture, but Internval was only a Java
Bean on accident. It had three methods starting with the word "get",
and that was it.
Nearly every POJO class written in Java should be a Bean if it has attributes.
At its bare minimum, the requirement for beanhood is to use getters and
setters for attributes. One doesn't have to add bean listeners and event
handlers.
Using getters and setters for attributes in Java is a universal idiom and a
best practice.
The OP's obsession with labeling every class in a program "bloat" or "silly"
seems predicated on a valid design principle: avoid bloat.
But he begs the question by labeling everything "bloat" indiscriminately.
Please, grz01, remember that the winning chess player sees the merit of his
opponent's strategy.
Rules of thumb are neither universal nor tyrannical. That code bloat is bad
does not imply that all code is bloat.
I suspect the problem is not of philosophy or practice but of description.
You espouse good practices; I feel you must understand the compromises and
balances in practice and are simply expressing your viewpoint didactically.
(Here I exemplify "Pot calling the kettle black.") This hypothesis gains
strength in light of your response.
grz01 wrote:
Hi Mark!
I looked again at your previous msgs in this thread and my replies,
and can only confirm I agree with everything you said.
....
--
Lew