Skip to content

lauritzthamsen/TraitClasses

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

96 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TraitClasses: Reconciling Classes and TraitsBuild Status

Reconciling Classes and Traits

An attempt to make parts of any class in Squeak/Smalltalk usable just like a trait. This way, programmers don't have to decide upfront to either implement functionality with a class or a trait and may even just reuse parts of classes.

This project was started in the course Module Systems at HPI's Software Architecture Group.

Installation

  1. Setup a Squeak image
  1. Install FileTree, see dalehenrich/filetree
  2. Clone TraitClasses repository, git clone [email protected]:lauritzthamsen/TraitClasses.git
  3. Load TraitClasses packages
  • In your Squeak image, open a Monticello Browser and add a new FileTree repository. Point it to the packages-subdirectory of the cloned repository you just created. Load the latest versions into the Monticello browser.

Note: Alternatively, the project with its dependencies can be loaded through its Baseline, see tests/travisCI.st.

Usage

Superclass subclass: #SubclassName
	"TraitClasses: include other (parts of) other classes"
	includes: { #OtherClass selectors: {#methodA . #MethodB} .
	    #AnotherClass
	      selectors: {#importantMethod}
	      protocols: {#enumeration}
	      variables: {#someVariable. #existingVariable useExisting. (#newVariable -> #usedVariable) useExisting}.
	}
	instanceVariableNames: 'existingVariable usedVariable'
	classVariableNames: ''
	poolDictionaries: ''
	category: 'Some-Category'

Trait Browser

Our repository also contains a TraitClasses-Browser package that provides an alternative system browser. While all browsers show class definitions with all their inclusions, this alternative browser provides buttons to hide and show included methods as well as inherited methods. After loading that package, you might want to register that browser as default system browser.

TraitBrowserScreenie

About

reconciling classes and traits a bit in Squeak

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •