SDSU CS 580 Client-Server Programming
Fall Semester, 2002
Previous    Lecture Notes Index    Next    
© 2002, All Rights Reserved, SDSU & Roger Whitney
San Diego State University -- This page last updated 16-Sep-02

Contents of Doc 5, Store


Source Code Management Guide, doc/SourceCodeMgmtGuide.pdf in VW 7 installation

Doc 5, Store Slide # 2


Store is VW source control management system

Store uses a database to store the source code

Store supports

These notes use PostgreSQL a free open source database

The class repository use PostgreSQL

Doc 5, Store Slide # 3

Running Your Own Local Repository

PostgreSQL Repository

Download & documentation

For instructions for install on Windows 2000

The Store PostgreSQL drivers are part of VW7

MS Access Repository

See instructions at:

On Sept 14, 2002 StoreForAccess was updated to correct a bug

The more recent version of StoreForAccess can be obtained on VW Public repository

To gain access to the repository see:

Doc 5, Store Slide # 4

Using Store

Loading Store into an Image

Load the StoreForPostgreSQL parcel

Use the Parcel manager

The “Load Parcel” icon is the left more icon on the icon bar.

Doc 5, Store Slide # 5

Packages, Parcels & Categories

Open a System browser

In Launcher in Browse menu select “System Browser”
Or select the “System Browsers” icon – the third icon from the left in the Launcher
System browser now supports three ways to organized code:

In the System browser use the “Browser” menu to switch between viewing the code via these methods

Doc 5, Store Slide # 6

A collection of classes

Use to view any class in the system

Doc 5, Store Slide # 7

A package can contain:

Development time grouping of related code

Packages can be stored in a repository

Can be grouped into bundles for large projects

Doc 5, Store Slide # 8

File based version of a Package

Runtime grouping of related code

Contains binary for fast loading

Can be created without Smalltalk source if you wish to hide source from users

Doc 5, Store Slide # 9

Using Packages

Creating a Package

Open a System browser and set it to view packages

In the System Browser “Browser” menu select “Package” item

In the System Browser “Package” menu select “New” and the submenu item “Package”

You will be prompted for a package name

For this document I will use the name “StoreLectureExamples”

With your new package selected in the System Browser “Package” menu select “Make Current”

This will cause any change you make anywhere in the system to be part of your package when you are dealing with Categories

Now you can set the browser to show categories until you are ready to save your code to the repository

Doc 5, Store Slide # 10
Adding Code to a Package


We will

Doc 5, Store Slide # 11
Changing an Existing Class

Go to the Integer class

Type “Integer” in the find box and hit return

Add the asGrade method to the converting category

   "Answer the letter grade represented by self"
   self > 90 ifTrue:[^'A'].
   self > 80 ifTrue:[^'B'].
   self > 70 ifTrue:[^'C'].
   self > 60 ifTrue:[^'D'].

In the bottom of the browser you should see that method is in your package. See below.

Doc 5, Store Slide # 12

Browser Level Source Control

The System browser provides some source control without dealing with Store

To see this functionality

Now click on the “Undo” icon to undo the last change

You can rollback all the changes to asGrade with the undo icon

Use the redo icon to redo each change

To see the history of all changes to asGrade

While asGrade is selected, in the browser “Method” menu select “Browse Versions”

Doc 5, Store Slide # 13
Creating a New Class

Create a new category for your new class

In the Browser “Category” menu select the “New” menu

Then create a new class

For the notes & class demo I will use the following class.

Smalltalk defineClass: #BankAccount
   superclass: #{Core.Object}
   indexedType: #none
   private: false
   instanceVariableNames: 'balance '
   classInstanceVariableNames: ''
   imports: ''
   category: 'Store-LectureNotes'
BankAccount class methodsFor: 'instance creation'
   ^super new initialize 
BankAccount methodsFor: 'accessing'
deposit: aNumber
   balance := balance + aNumber
withdrawl: aNumber
   balance := balance - aNumber 
   balance :=0 

Doc 5, Store Slide # 14

Connecting to the CS580 Store Repository

Before saving a package we must connect to the repository

To connect to the CS580 repository on your machine needs a connection to the Internet

In the Launcher Store menu select the “Connect to Repository” item

Doc 5, Store Slide # 15
First Time Connection

In the “Connect to Database” window:

For Interface select PostgreSQLEXDIConnection
For Environment type rugby.sdsu.edu_cs580
Contact me for a username and password
Keep BERN as owner of the table.

If you click on the “Save...” button you can give the settings a name to make it easier to connect later.

Now click on the “OK” button to connect to the repository

If all went well you are now connected to the repository. If you do not get any errors you will be connected.

Doc 5, Store Slide # 16
Viewing Existing Items in the Repository

Once you are connected to a repository you can view its contents

In the Launcher’s “Store” menu select “Published Items”

The resulting window will show you the contents of the repository. When you select a package you will see the different versions of the package. When you select version you see the comment for that version. When a version is selected you can either right click in the upper right window or use the File menu to load that version into your image.

Doc 5, Store Slide # 17
Putting a Package into the Repository

To put a package into a repository

There are a number of other useful things one can do like merge different versions of a package. However, you should know enough to read the manual to find out how to do that.

Copyright ©, All rights reserved.
2002 SDSU & Roger Whitney, 5500 Campanile Drive, San Diego, CA 92182-7700 USA.
OpenContent license defines the copyright on this document.

Previous    visitors since 16-Sep-02    Next