alice-teacher Export a person in Alice 3

Donald Slater don at alice.org
Tue Jan 14 07:18:59 EST 2020


James,
You are correct. The Export / Import is not true sub-classing in the Alice system. It is instead more of an export and merge new features into an existing class. It was decided by the team that this concept was better handled in the Alice - NetBeans curriculum - students import their projects into NetBeans where the Project is now a true Java project, with access to the entire Java Class Library and a inheritance would be better implemented.

All the best,
Don Slater

Alice Project

> On Jan 13, 2020, at 3:39 PM, Vanderhyde, James <vanderhyde at sxu.edu> wrote:
> 
> Don, thanks. One more question. It looks to me like you can’t export classes in Alice 3 at all. All you can do is customize existing classes, and export the customizations. You can’t create your own classes. For example, you can’t create one subclass of Fox called FancyFox and another subclass called FancierFox, two classes that do different things, so that some of your objects are FancyFoxes and some are FancierFoxes. Because when you import a class, or even instantiate a class from “My Classes” in the gallery, it does not create a new class; it just adds the custom methods, etc., to the built-in Fox class.
> 
> Or am I misunderstanding this?
> 
> James
>> James Vanderhyde
> Associate Professor and Department Chair
> Computer Science
> Saint Xavier University
> 3700 W. 103rd St.
> Chicago, IL 60655
> 773-298-3454
> 
> On Jan 13, 2020, at 1:05 PM, Donald Slater <don at alice.org <mailto:don at alice.org>> wrote:
> 
> Jim,
> This is a great question, and one that should work better than my hack. 
> 
> Alice 3 does provide access to class constructors (Go to Window: Preferences and select the Constructors menu option - see attached screen shot)
> 
> And in fact the constructor for that Person class, when enabled, allows you to design your avatar.
> 
> Unfortunately, when you export that class, the modified constructor does not get exported with the rest of the class.I hope that this is something we can fix in future releases, as it would be the more elegant, and OOP-based, solution.
> 
> I am sorry, but thank you for identifying this issue for us.
> 
> All the best,
> Don Slater
> 
> Alice Project
> 
> 
> 
> <cTor_Preference.png>
> 
>> On Jan 13, 2020, at 9:44 AM, Vanderhyde, James <vanderhyde at sxu.edu <mailto:vanderhyde at sxu.edu>> wrote:
>> 
>> Don, thanks. In Java, you can extend a class with the only new thing being a new constructor that sets all the property values the way you want them. Is there a way to do this in Alice 3?
>> 
>> James
>>>> James Vanderhyde
>> Associate Professor and Department Chair
>> Computer Science
>> Saint Xavier University
>> 3700 W. 103rd St.
>> Chicago, IL 60655
>> 773-298-3454
>> 
>> On Jan 12, 2020, at 7:47 PM, Donald Slater <dslater at andrew.cmu.edu <mailto:dslater at andrew.cmu.edu>> wrote:
>> 
>> James,
>> You are correct, that because the Alice 3 Export  function exports essentially a Java class, methods, functions, class properties of the class will be exported. But not the particular characteristics fo an object of that class.
>>  
>> If Alice allowed the creation of properties and variables of the type adultPersonResource, teenPersonResource, childPersonResource, etc, then one could create a class property of that resource with the specific values of the avatar, which would be exported with the class. That may be worth investigating for future releases.
>> 
>> But I did come up with a work-around, a hack, actually  ;-) Using the TeenPerson class
>> 
>> 1) Create a method for the person class, name it something like setMyResource…
>> 2) Inside that method, use the  setTeenPersonResource to build the avatar. (This will not change the appearance of the avatar in the scene until the method setMyResource is called). See the attached screen shot.
>> 3) You may now export this class, and the setMyResource method, with the specific values for the avatar will be exported as part of this method.
>> 4) When you import this class into a new project, call the setMyResource method as the first line of code, and the avatar in the scene will take on the desired appearance at runtime.
>> 
>> I have also attached a sample project that you might play with.
>> 
>> It is a hack, but it is something until until we come up with a more elegant solution.
>> 
>> Lete me know if you have any questions.
>> 
>> All the best,
>> Don Slater
>> 
>> Alice Project
>> 
>> <p1.png>
>> 
>>> On Jan 12, 2020, at 9:03 AM, Vanderhyde, James <vanderhyde at sxu.edu <mailto:vanderhyde at sxu.edu>> wrote:
>>> 
>>> Hello, everyone. I have made the jump from Alice 2 to Alice 3. Is there any guide to Alice 3 for long-time users of Alice 2? I am hitting a problem right away. In Alice 2, I had each of my students create an “avatar” using the He/she builder, export the object, and use it in every one of their homework assignments. I can’t find a way to export a carefully crafted person in Alice 3 for use in other projects. The class export system seems to be completely different.
>>> 
>>> James
>>>>>> James Vanderhyde
>>> Associate Professor and Department Chair
>>> Computer Science
>>> Saint Xavier University
>>> 3700 W. 103rd St.
>>> Chicago, IL 60655
>>> 773-298-3454
>>> 
>>> _______________________________________________
>>> alice-teachers mailing list
>>> alice-teachers at lists.andrew.cmu.edu <mailto:alice-teachers at lists.andrew.cmu.edu>
>>> To change settings or unsubscribe visit:
>>> https://lists.andrew.cmu.edu/mailman/listinfo/alice-teachers <https://lists.andrew.cmu.edu/mailman/listinfo/alice-teachers>
>> <ResourceImportDemo.a3p>
>> 
>> _______________________________________________
>> alice-teachers mailing list
>> alice-teachers at lists.andrew.cmu.edu <mailto:alice-teachers at lists.andrew.cmu.edu>
>> To change settings or unsubscribe visit:
>> https://lists.andrew.cmu.edu/mailman/listinfo/alice-teachers <https://lists.andrew.cmu.edu/mailman/listinfo/alice-teachers>
> _______________________________________________
> alice-teachers mailing list
> alice-teachers at lists.andrew.cmu.edu <mailto:alice-teachers at lists.andrew.cmu.edu>
> To change settings or unsubscribe visit:
> https://lists.andrew.cmu.edu/mailman/listinfo/alice-teachers
> 
> _______________________________________________
> alice-teachers mailing list
> alice-teachers at lists.andrew.cmu.edu
> To change settings or unsubscribe visit:
> https://lists.andrew.cmu.edu/mailman/listinfo/alice-teachers

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.andrew.cmu.edu/pipermail/alice-teachers/attachments/20200114/0361957f/attachment.html>


More information about the alice-teachers mailing list