[Bluej-discuss] Extension development question
Paul Byrne
Paul.Byrne at Sun.COM
Thu Mar 2 20:41:35 GMT 2006
Hi Damiano,
Thanks for the detailed answer. Let me try and give some more details
about what I think I need and hopefully we can find
a way to implement it.
My main focus is to hide a lot of the complexity of my implentation from
the students, providing very simple classes that 'wrap' my more complex
implementation classes. The wrapper would need to make methods calls to
the implementation class which would then call into the lg3d-core jar.
The only way I can see to achieve this at the moment is to start lg3d in
another vm and use rmi to communicate. Not something I really want to do
as it can be fragile and tricky to setup.
I can't currently think of a way to put everything into the project lib
as I need to open a window to contain the 3D world and the 3D
representations of the objects they user code is manipulating.
Are then any hooks into the classloading system in BlueJ that we could
exploit to bridge the gap between Project code and extensions ?
Rgds
Paul
Ing. Damiano Bolla wrote:
>Hi Paul
>
>- If you want to let the students "manipulate" your class (that is editing
>source code and so on) then you have to put the source into a BlueJ
>project.
>
>- If you want the user be able to "new" your class and the use the
>methods, it is not easy but can be done, let me explain what cannot be
>done.
>You cannot ge hold of the classloader that is actually holding the
>extension, extensions are loaded each within a separate classloader from
>the Project classloader.
>
>So, what can be done is to create a blueJ project with a skeleton
>framework (think of the Canvas class in the shape project) that skeleton
>can basically do what you wish, you can talk with your extension using
>sockets, or any other way you wish.
>
>If you "just" want to instantiate it then you could always add the jar to
>the list of jars that are loaded in the project library, I think it is
>everythign that is in th +libs directory of the project, once your jar is
>visible in the Project classloader then you could either new your class
> from you skeleton or ask to the user to use the "TOols"->"Use Library Clas"
>But remembar, the class you just created is not in the same classloader
>space as your extension.
>
>I may come up with some other ways if you tell us what should the student
>be allowed to do.
>
>Damiano
>
>
>
>On Thu, 02 Mar 2006 18:42:58 +0100, Paul Byrne <Paul.Byrne at Sun.COM> wrote:
>
>
>
>>Team,
>>
>>I was talking to Emil Sarpa again today and we got around to the subject
>>of using Project Looking Glass in BlueJ to potentially add another
>>dimension ;-) to the examples students can work on.
>>
>>I've spent this evening looking at BlueJ and reading through the
>>extensions documentation. I've created some experimental code in attempt
>>to figure out what is possible in the current framework. One thing I've
>>not figured out yet, and was hoping you could help, is how to make
>>classes in extensions available for use in student code.
>>
>>For example I have a UserTest class in my extension and I'd like to be
>>able to either instantiate this directly in the bluej UI or create a
>>subclass of it. Is this possible ?
>>
>>Rgds
>>
>>Paul
>>
>>_______________________________________________
>>mailing list bluej-discuss at bluej.org
>>To unsubscribe or change your preferences, go to
>>http://lists.bluej.org/mailman/listinfo/bluej-discuss
>>
>>
>>
>
>
>_______________________________________________
>mailing list bluej-discuss at bluej.org
>To unsubscribe or change your preferences, go to
>http://lists.bluej.org/mailman/listinfo/bluej-discuss
>
>
More information about the bluej-discuss
mailing list