[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
|
[aspectj-users] Dynamic use of Inter-Type Declarations
|
- From: "Kaare Nilsen" <kaare.nilsen@xxxxxxxxx>
- Date: Tue, 28 Mar 2006 12:02:34 +0200
- Delivered-to: aspectj-users@eclipse.org
- Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; b=fQaDbG1fGjaJION7dwWjRNWQFjccingSAL7DcSvgKSh0Bj2epS5s936M5zQSXNoY7vOexUE2QIFEFIuC2fAtVIK3o/y96+ujPnFm7hgX+069yJpIR1i6cCWYGQoqYwBWb9snECwAEGgwX03nDsUU1xrAbBzYleJsIRDj/L02kmU=
Hi guys/girls.
I have a question that I was not able to compute when reading my
aspectJ books, and doing some googling.
The question is:
Is there a way of dynamicly at runtime add a new Inter-Type
Declaration on an object ?
Lets say I have a swing app with a panel containg a tree view of cd's
where the actual cd is the leaf.
One cd's could appair as a leaf in different subtrees (dimensions) e.g
Genre dimension
Genre
+- Classical
+- Mozart, Wolfgang Amadeus
+- Mass in C minor
-- Monteverdi Choir, John Elliot Gardiner
Playlist dimension
Down-Right-Terrific-Music
-- Monteverdi Choir, John Elliot Gardiner
Then what I would like is to have an Inter-Type Declaration that
allows editing of data by adding an "Editable" interface and a
corresponding implementation.
In the treeview I then would like to use, let say, a right click on
the leaf and a context menu with all the legal functionality for that
leaf would pop up. I was thinking of using instanceof checking for
that.
So the main point beeing. In the Genre dimention i would like the Leaf
to implement the Editable interface, but in the Playlist dimention it
should not.
Is this at all possible ?
Best regards
Kaare Nilsen