Adding and removing classes or methods from a Monticello Package
Last updated at 7:44 am UTC on 5 May 2006
A Monticello package is a union of core classes and extension classes which define a portable application. "Everything" in the core classes belongs to the package. If you want to change the instance variables, class variables or pool dictionaries of a class as part of delivering the package you must make that class a core class of your application. Core classes are those where all methods, except those explicitly excluded, belong to the package. Extension classes are those where only methods that are explicitly included are part of the package. To exclude a method from a core class, you give it the package method category of a different package. To include a method from an extension class, you give it the package method category of a that package.
Defining a package
To define a Package called "MyApplet", open the Monticello Browser, click on "+Package". When the window comes up type in "MyApplet" and accept. See Monticello Basics for screen shots, See Versioning with Monticello for how to define, save and version a package.
Adding or removing a core class
To make a class a part of package a, simply change the class category to begin with your package name. For example:
Object subclass: #Foo
Foo is now a core class of "MyApplet". To remove it from your package you can delete it or simply change the class category to something else.
Adding or removing a method from an extension class
If there is a class that is not part of your package but for which you want to add one or more methods, you do so by adding the method to the class and giving it the appropriate method category. For example, if there was a class:
Object subclass: #Bar
to which you wanted to add the method fooBar, then after adding that method you would change the method category to be "*myapplet". Bar is now an extention class and fooBar is an extension method of your method. To remove fooBar from your package you can delete it fromBar or simply change the method category to something else. You might do later for example, if fooBar became part of the kernel and no longer needed to be part of you package.
Adding or removing a method from an core class
All methods in a core class are automatically part of your package unless their method category defines them as an extension method of another package. , If there is a class that is not part of your package but for which you want to add one or more methods, you do so by adding the method to the class and giving it the appropriate method category. For example, if there was a class:
Object subclass: #Foo
that is part of the MyApplet package and someone else added the method fooBar2 to it with the method category "*some" then foobar2 would not be distributed as part of MyApplet but the rest of Foo would.