Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
RE: breaking changes in 4.0 for CDI (was: RE: [cdt-debug-dev] Lis t of Plan items)

At 01:45 PM 10/23/2006, Alain Magloire wrote:


> From: cdt-debug-dev-bounces@xxxxxxxxxxx [mailto:cdt-debug-dev-
> bounces@xxxxxxxxxxx] On Behalf Of Mikhail Khodjaiants
> Sent: Wednesday, October 18, 2006 1:31 PM
> To: CDT Debug developers list
> Subject: RE: breaking changes in 4.0 for CDI (was: RE: [cdt-debug-dev]
> List of Plan items)
>
> > For example adding IAdaptable to ICDIObject and ICDISessionObject are
> breaking changes.
>
> There are many ways to minimize the impact of this type of changes.
> For example, introduce new ICDIObject2 and ICDISessionObject2 interfaces
> and add two new abstract classes:
>
> abstract class AbstractObject implements ICDIObject, ICDIObject2
>
> abstract class AbstractSessionObject implements ICDISessionObject,
> ICDISessionObject2
>
> Implementors can use theses classes as base classes for their hierrachy.
> It's not a very good solution, but it covers most of the use cases.
>
> I agree, 4.0 is a major release, but we at least should try to make the
> transition easier.
>

It seems to be the same i.e. the client must still do instanceof:

 if (obj1 instanceof ICDIObject2) {
        ICDIObject2 obj2 = (ICDIObject2)obj1;
        MyClass clz = obj2.getAdapter(MyClass.class);
 }

So still a lot of instanceof for little gain, IMHO.

So, why the hesitation?  I would prefer to fix things right at the root and
a 4.0 release is a good candidate, IMHO?

Any other votes/takes on this?

I agree. You end up with a new instanceof in order to avoid another.

John


Back to the top