Maybe IModel<? extends T> is better, or?

Regards,
Peter

2010-09-15 16:02 keltezéssel, Martin Grigorov írta:
> Looks good to me.
> I've never seen that this ctor looks this way and I don't remember
> discussion related to that.
> 
> On Wed, Sep 15, 2010 at 3:22 PM, Ernesto Reinaldo Barreiro <
> [email protected]> wrote:
> 
>> My apologies if this has been discussed before...
>>
>> Right now the constructor of CompoundPropertyModel is as follows:
>>
>>        /**
>>         * Constructor
>>         *
>>         * @param object
>>         *            The model object, which may or may not implement
>> IModel
>>         */
>>        public CompoundPropertyModel(final Object object)
>>        {
>>                target = object;
>>        }
>>
>> which allows users to do something like:
>>
>> new CompoundPropertyModel<XXX>(new YYY());
>>
>> without generating a compiler error. Would it make sense to replace
>> this constructor by two constructors...
>>
>>        /**
>>         * Constructor
>>         *
>>         * @param object
>>         *            The model object
>>         */
>>        public CompoundPropertyModel(final T object)
>>        {
>>                target = object;
>>        }
>>
>>        /**
>>         * Constructor
>>         *
>>         * @param object
>>         *            an instance of IModel<T>
>>         */
>>        public CompoundPropertyModel(final IModel<T> object)
>>        {
>>                target = object;
>>        }
>>
>> at least on 1.5?
>>
>> Regards,
>>
>> Ernesto
>>
> 

Reply via email to