Introduction to Alice Basics: •What is Alice? •Object Oriented Definitions •What Does it Look Like? •Where Can I Use it? What is Alice ? Alice (http://www.alice.org) is a 3-D Interactive Graphics Programming Environment Developed at Carnegie Mellon Alice is built on top of the programming language Python The goal of the Alice project is to make it easy for novices to develop interesting 3-D environments and to explore the new medium of interactive 3-D graphics A tool for teaching concepts of fundamental programming: Objects Classes Methods Events What is Alice ? Alice is primarily a scripting and prototyping environment for 3-D object behavior 3-D models of objects (e.g., animals and vehicles) populate a virtual world in Alice. By writing simple scripts, Alice users can control object appearance and behavior Presents Object-Oriented Design A software design method that models the characteristics of abstract or real objects using classes and objects What is Alice ? The Alice Approach Uses 3D graphics to engage students Has a “smart” drag-and-drop editor that prevents syntax errors What is Alice ? Key Alice Features Makes objects something students can see and relate to Has a java syntax mode to ease the transition to C++/Java/VB.net What is Alice ? Schools using Alice 2004-2005: • Bucknell University • Carnegie Mellon University • Clemson University • Colorado School of Mines • Community College of Philadelphia • Cornell University • Duke University • Ithaca College • Plymouth State University • Saint Joseph's University • Saint Lawrence College • San Diego State University • University of Colorado • University of Illinois • University of Mississippi • Virginia Tech Object Oriented Definitions Object Definition: An object is a software bundle of variables and related methods Object is defined by its properties and its methods/functions Real-world objects share two characteristics: State and Behavior • For example, dogs have state (name, color, breed, hungry) and behavior (barking, fetching, and wagging tail) Object Oriented Definitions Object Software objects are modeled after real-world objects in that they too have state and behavior A software object maintains its state in one or more variables A variable is an item of data named by an identifier A software object implements its behavior with methods A method is a function (subroutine) associated with an object Object Oriented Definitions Class Definition: A class is a blueprint that defines the variables and the methods common to all objects of a certain kind In the real world, you often have many objects of the same kind For example, your car is just one of many vehicles in the world This means that car is one of the choices within the vehicle class Object Oriented Definitions Class Using object-oriented terminology, we say that your car object is an instance of the class of objects known as vehicles Vehicles have some state (four wheels) and behavior (accelerate, brake) in common. However, each vehicle's state is independent of and can be different from that of other vehicles Object Oriented Definitions Method Definition: A method is a piece of code that is exclusively associated either with a class (called class methods) or with an object (called instance methods) Like a procedure in procedural programming languages, a method usually consists of a sequence of statements to perform an action, a set of input parameters, and possibly an output value of some kind The purpose of methods is to provide a mechanism for accessing (for both reading and writing) the private data stored in an object or a class Object Oriented Definitions Method Methods are essentially instruction sets for objects Consequently, rather than thinking a method is just a sequence of commands, an OO programmer will consider a method to be "an object's way of providing a service" (its "method of doing the job", hence the name) A method call is thus considered to be a request to an object to perform some task Method calls are often modeled as a means of passing a message to an object Object Oriented Definitions Method For Example: The Drive method for a car would consist of turning left ¼ and moving away for a distance of 10 meters car Methods car.Drive ( ) No variables Do in order car turn left 0.25 revolutions car move forward 10 meters Object Oriented Definitions Event Definition: An event is an action or occurrence detected by a program Events can be user actions, such as clicking a mouse button or pressing a key, or system occurrences, such as running out of memory Most modern applications are said to be event-driven, because they are designed to respond to events What Does it Look Like ? Where Can I Use it ? Computer Lab Alice is loaded on the computers in the CCRI Academic Computer Lab Look for the Alice icon on the desktop or under Programs from the Windows Start Menu Download •ALICE Programming software - can be downloaded at http://www.alice.org (download the most recent version) •The download is 115 Megabytes so may be difficult if you do not have access to a broadband network.