Magma as a code-repository
Last updated at 1:35 pm UTC on 20 July 2005
Magma can be a repository for code. The API supports three kinds of code elements:
- individual Classes
- ChangeSets
- Monticello packages
Because Magma is able to treat each of these as plain objects, they are subject to, and benefit from, all the side-effects of Magma's multi-user and transactional system.
Usage
Usage is provided through a MagmaRepositoryCodeBase, which is obtained from the MagmaSession. This is a simple class which simply has three Dictionary's, one for Classes, one for ChangeSets and one for Packages.
To get the codeBase:
mySession codeBase
Classes and ChangeSets are accessed through snippets of code. Packages are accessed via Monticello's user-interface.
Classes
"File-out a Class"
mySession commit: [ mySession codeBase fileOutClass: MyClass ]
"load a class"
mySession codeBase fileInClassNamed: #MyClass
"browse a class in a code-file browser before filing it in"
mySession codeBase browseClassNamed: #MyClass
"Answer a collection of all class names in the codeBase"
mySession codeBase classNames
"Install all the classes into my image immediately."
mySession codeBase installClasses
ChangeSets
"file-out a ChangeSet"
mySession commit: [ mySession codeBase fileOutChangeSet: (ChangeSorter changeSetNamed: 'myChangeSet') ]
"Load a ChangeSet"
mySession codeBase fileInChangeSetNamed: 'myChangeSet'
"browse a change-set before filing it in"
mySession codeBase browseChangeSetNamed: 'myChangeSet'
"Answer a collectioon of all changeSet names in the codeBase."
mySession codeBase changeSetNames
"Install all the changeSets in the codeBase immediately."
mySession codeBase installChangeSets
Monticello packages
For Monticello packages you use the Monticello GUI, click on the +Repository button and then select one of the Magma options.