Smalltalk
DependencyBrowser
Description

A tool for interactive edition and visualization of dependencies using a classic system-like browser in Squeak or Pharo Smalltalk.

Audience

This utility could be useful to whom it needs to arm a production release or just perform an early exploration of a package. From the following I will use Package indifferently to Class Category.

Installation

Once inside the image, use Monticello or Installer to install.

Installation in Squeak

  " Copy, paste and select the following script 
in your image and doIt "
 
| mc  files fileToLoad version instClass |
 
mc := Smalltalk at: #MCHttpRepository 
	ifPresent: [:repoClass | 
			repoClass location: 'www.squeaksource.com/Installer' 
						user: 'squeak' 
						password: 'squeak'].
	
files := mc readableFileNames 
		asSortedCollection: [:a :b | 
			[ (a findBetweenSubStrs: #($.)) allButLast last asInteger > 
				(b findBetweenSubStrs: #($.)) allButLast last asInteger ] 
			on: Error 
			do: [:ex | false] ].
		
fileToLoad := files detect: [ :aFile | aFile beginsWith: 'Installer-Core' ] ifNone: [ nil ].
version := mc versionFromFileNamed: fileToLoad.
version workingCopy repositoryGroup addRepository: mc.
mc creationTemplate: mc asCreationTemplate.
version load.
instClass := Smalltalk at: #Installer.
 
instClass ss
		project: 'XMLSupport';
		install: 'XML-Parser';
		project: 'universes';
		install: 'Universes'.
 
instClass ss 
	project: 'DependencyWalker';
	install: 'PreDWFixes'.
	
instClass universe update;
	addPackage: 'OmniBrowser';
	addPackage: 'OmniBrowser-Standard';
	addPackage: 'OmniBrowser-Morphic';
	addPackage: 'OmniBrowser-Refactory';		
	addPackage: 'OB-Enhancements';
	install.
		
instClass ss 
	project: 'DependencyWalker';
	install: 'DependencyWalker';
	install: 'OBDependencyWalker';	
	install: 'DWTraitsFix';
	install: 'OBDWMethodNodeFix'
 

Installation in Pharo

  " Copy, paste and select the following script 
in your image and doIt "
| instClass |
ScriptLoader loadOB.
instClass := Smalltalk at: #Installer ifAbsent: [ ScriptLoader new installingInstaller ].
instClass ss project: 'DependencyWalker'.
	install: 'DependencyWalker';
	install: 'OBDependencyWalker';
	install: 'DWTraitsFix'
 

Opening Squeak

From the World Menu click in the "open..." item and choose the "Dependency Browser" option.

World Menu

Opening Pharo

Open the browser from the World Menu, choose the "Tools" option, the "More" sub-item and then the "Dependency Browser" item.

World Menu
Purpose of the Dependency Browser

Probably the use case most recurrent will be when you want to distribute a tool and you need to check which packages are needed before correct installation or utilization on target machine. This functionality is already provided in some Smalltalks by true package objects (some people call them "Components"), but one difference with this browser is the chance of interactive edition of dependencies using a classic system-like browser.

Currently the browser can visualize three major types of code dependencies:

And finally one filter to show only the dependencies of packages that you've installed, that is, does not belong to the official image distribution.

The (R)eferences
Dependency Browser References Screenshot
The (I)nheritances
Dependency Browser Inheritances Screenshot
The (L)oose (M)ethods
Dependency Browser Loose Methods Screenshot
The (N)on-(S)ystem Packages
Dependency Browser Non-System Packages Screenshot
Contacto
Hernán Morales Durand