avalon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Hamilton Verissimo de Oliveira (Engenharia - SPO)" <hamilton.olive...@agenciaclick.com.br>
Subject Re: [RT] JavaBeans are even more evil than first thought
Date Fri, 23 Jan 2004 22:24:21 GMT

-----Mensagem original-----
De: Leo Sutic [mailto:leo.sutic@inspireinfrastructure.com]


> Well, *I* think this one is a winner. (Whether it is realized via
> XStream
> or attributes is not that relevant.)

Which could be rewritten as 

    public class Radar implements Initializable {

        private int minRange;

        private int maxRange;

        public void setMaxRange (int _maxRange) {
            maxRange = _maxRange;
        }

        public void setMinRange (int _minRange) {
            minRange = _minRange;
        }

        public void initialize() {

            if (minRange > maxRange) {
                throw new IllegalStateException("min-range >
max-range");
            }
        }
    }

--

;-)


hammett


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@avalon.apache.org
For additional commands, e-mail: dev-help@avalon.apache.org


Mime
View raw message