[Monticello2] Key classes

Colin Putney cputney at wiresong.ca
Fri Jun 22 06:29:54 UTC 2007

On Jun 21, 2007, at 8:14 AM, Damien Cassou wrote:

> Hi Colin and Avi,
> I've created an UML diagram with the main MC2 classes :
> http://wiki.squeak.org/squeak/5997.
> IIUC, MC2 does not write slices to the repository. Only the elements
> contained in the slice. Is that true? Why don't you commit the slices
> themselves?

It's true that we don't commit slices to the repository, yes. But  
slices don't really "contain" elements, they just enumerate them.  
(MDExplicitSlice is the obvious exception to this, but it's meant  
mainly for testing.) The role of a slice is to divide the image into  
two parts: the parts that belong to the slice and the parts that  
don't. MDPackageInfoSlice does this on the basis of a PackageInfo  
instance - anything in the package belongs to the slice, anything not  
in the package does not. The plan is to have other types of slices as  
well, based on ChangeSets, RefactoringEnvironments, and anything else  
that seems interesting.

Also, elements aren't committed to the repository per se, but only as  
part of an MDVersion.

> Another, maybe related question, what are snapshots? Colin gave a
> definition in the previous link, but this is still not clear to me.
> What is the difference with slices? Are they really required?

Yes, they are absolutely required. A snapshot is the the equivalent  
of a Version in Monticello1. Remember that a Version in Monticello2  
records the state and history of a particular method (or other  
element). A snapshot gathers these all together into a coherent set  
that belong together. It's a list of "this version of method A" and  
"that version of method B," describing what was in your image when  
you created the snapshot.

When a snapshot is created, a slice decides which methods should be  
part of it, and the resulting snapshot describes the state of those  
methods and their versioning history.

> What is a memo? What are its instance variables reference, parents,
> properties and sliceId?

A Memo isn't strictly needed for MC2's versioning model. Instead it's  
a performance enhancement for a very common case that arises when  
dealing with repositories. The problem is this: Imagine that you're  
going to update your image. You open a repository and get a list of  
the snapshots it contains. You browse this list until you find the  
snapshot you want, and then load it into your image.

Now, getting a list of snapshots from a repository is a pretty  
straightforward operation, but it doesn't give much information. All  
the metadata for the snapshot is stored separately. So building the  
list of snapshots to display to the user would involve two round  
trips to the repository - one to get the list of snapshots, and  
another to get all the metadata. A memo is just a bundling of that  
metadata in a form that's convenient for displaying to the user. By  
asking the repository for that information directly, the UI enables  
to repository to gather it in a way that's efficient for the  
repository implementation.

Does that make sense?


More information about the Squeak-dev mailing list