Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
RE: [aspectj-users] can you say that AspectJ types are Java types?

I would say that certainly every class and every aspect has a type,
however I believe their type systems should be orthogonal.

In general there is a common misconception that a Java class is a type.
This is wrong. Strictly speaking, the type of a class is actually
"Class". Objects of a single class can then have various types. (e.g. an
ArrayList has types ArrayList, List, Collection, ...)

Conceptually, an aspect is never a class. Classes and aspects are just
plain different constructs. Classes allow to instantiate objects
explicitly, aspects not. Classes also have different scoping rules from
aspects. Concrete classes can have subclasses, concrete aspects not.
Aspects have advice/ITDs, classes not...

In some cases, it might however be useful to see an aspect instance as
an object. The would then have the type of its underlying aspect. 

You are right that in AspectJ aspects compile to classes but this is
rather a technical issue and has nothing to do with the type system and
is therefore not a valid argument in such discussions IMHO.

Eric

> -----Original Message-----
> From: aspectj-users-bounces@xxxxxxxxxxx [mailto:aspectj-users-
> bounces@xxxxxxxxxxx] On Behalf Of Eugene Kuleshov
> Sent: Wednesday, November 29, 2006 5:25 PM
> To: aspectj-users@xxxxxxxxxxx
> Subject: [aspectj-users] can you say that AspectJ types are Java
types?
> 
> Hi,
> 
>   Some time ago I had an argument with Matt Chapman from AJDT project
> about meaning of AspectJ types. I've been asking to show them together
> with other Java types instead of providing a separate dialog specific
> for those types only. This is kinda interesting, because @AspectJ
types
> are regular classes and being shown in "Open Type..." dialogs and
other
> places. But even so types compiled from AspectJ are regular Java
> classes and those classes can be used from other Java classes (i.e.
> using
> aspectOf() method or custom static methods) they are not shown with
the
> regular Java classes.
> 
>   So, I wonder what community think about this issue, from both points
> of view, conceptually (is AspectJ classes are Java classes?) and
> practically (should they shown together with Java types in IDEs?).
> 
>   See discussion on Eclipse AJDT bug report at
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=161890
> 
>   Thanks
> 
>   Eugene
> 
> 
> _______________________________________________
> aspectj-users mailing list
> aspectj-users@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/aspectj-users


Back to the top