8.17: Chapter Summary
- Page ID
- 45553
\( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)
\( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)
\( \newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\)
( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\)
\( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\)
\( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\)
\( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\)
\( \newcommand{\Span}{\mathrm{span}}\)
\( \newcommand{\id}{\mathrm{id}}\)
\( \newcommand{\Span}{\mathrm{span}}\)
\( \newcommand{\kernel}{\mathrm{null}\,}\)
\( \newcommand{\range}{\mathrm{range}\,}\)
\( \newcommand{\RealPart}{\mathrm{Re}}\)
\( \newcommand{\ImaginaryPart}{\mathrm{Im}}\)
\( \newcommand{\Argument}{\mathrm{Arg}}\)
\( \newcommand{\norm}[1]{\| #1 \|}\)
\( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\)
\( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\AA}{\unicode[.8,0]{x212B}}\)
\( \newcommand{\vectorA}[1]{\vec{#1}} % arrow\)
\( \newcommand{\vectorAt}[1]{\vec{\text{#1}}} % arrow\)
\( \newcommand{\vectorB}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)
\( \newcommand{\vectorC}[1]{\textbf{#1}} \)
\( \newcommand{\vectorD}[1]{\overrightarrow{#1}} \)
\( \newcommand{\vectorDt}[1]{\overrightarrow{\text{#1}}} \)
\( \newcommand{\vectE}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash{\mathbf {#1}}}} \)
\( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)
\( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)
\(\newcommand{\avec}{\mathbf a}\) \(\newcommand{\bvec}{\mathbf b}\) \(\newcommand{\cvec}{\mathbf c}\) \(\newcommand{\dvec}{\mathbf d}\) \(\newcommand{\dtil}{\widetilde{\mathbf d}}\) \(\newcommand{\evec}{\mathbf e}\) \(\newcommand{\fvec}{\mathbf f}\) \(\newcommand{\nvec}{\mathbf n}\) \(\newcommand{\pvec}{\mathbf p}\) \(\newcommand{\qvec}{\mathbf q}\) \(\newcommand{\svec}{\mathbf s}\) \(\newcommand{\tvec}{\mathbf t}\) \(\newcommand{\uvec}{\mathbf u}\) \(\newcommand{\vvec}{\mathbf v}\) \(\newcommand{\wvec}{\mathbf w}\) \(\newcommand{\xvec}{\mathbf x}\) \(\newcommand{\yvec}{\mathbf y}\) \(\newcommand{\zvec}{\mathbf z}\) \(\newcommand{\rvec}{\mathbf r}\) \(\newcommand{\mvec}{\mathbf m}\) \(\newcommand{\zerovec}{\mathbf 0}\) \(\newcommand{\onevec}{\mathbf 1}\) \(\newcommand{\real}{\mathbb R}\) \(\newcommand{\twovec}[2]{\left[\begin{array}{r}#1 \\ #2 \end{array}\right]}\) \(\newcommand{\ctwovec}[2]{\left[\begin{array}{c}#1 \\ #2 \end{array}\right]}\) \(\newcommand{\threevec}[3]{\left[\begin{array}{r}#1 \\ #2 \\ #3 \end{array}\right]}\) \(\newcommand{\cthreevec}[3]{\left[\begin{array}{c}#1 \\ #2 \\ #3 \end{array}\right]}\) \(\newcommand{\fourvec}[4]{\left[\begin{array}{r}#1 \\ #2 \\ #3 \\ #4 \end{array}\right]}\) \(\newcommand{\cfourvec}[4]{\left[\begin{array}{c}#1 \\ #2 \\ #3 \\ #4 \end{array}\right]}\) \(\newcommand{\fivevec}[5]{\left[\begin{array}{r}#1 \\ #2 \\ #3 \\ #4 \\ #5 \\ \end{array}\right]}\) \(\newcommand{\cfivevec}[5]{\left[\begin{array}{c}#1 \\ #2 \\ #3 \\ #4 \\ #5 \\ \end{array}\right]}\) \(\newcommand{\mattwo}[4]{\left[\begin{array}{rr}#1 \amp #2 \\ #3 \amp #4 \\ \end{array}\right]}\) \(\newcommand{\laspan}[1]{\text{Span}\{#1\}}\) \(\newcommand{\bcal}{\cal B}\) \(\newcommand{\ccal}{\cal C}\) \(\newcommand{\scal}{\cal S}\) \(\newcommand{\wcal}{\cal W}\) \(\newcommand{\ecal}{\cal E}\) \(\newcommand{\coords}[2]{\left\{#1\right\}_{#2}}\) \(\newcommand{\gray}[1]{\color{gray}{#1}}\) \(\newcommand{\lgray}[1]{\color{lightgray}{#1}}\) \(\newcommand{\rank}{\operatorname{rank}}\) \(\newcommand{\row}{\text{Row}}\) \(\newcommand{\col}{\text{Col}}\) \(\renewcommand{\row}{\text{Row}}\) \(\newcommand{\nul}{\text{Nul}}\) \(\newcommand{\var}{\text{Var}}\) \(\newcommand{\corr}{\text{corr}}\) \(\newcommand{\len}[1]{\left|#1\right|}\) \(\newcommand{\bbar}{\overline{\bvec}}\) \(\newcommand{\bhat}{\widehat{\bvec}}\) \(\newcommand{\bperp}{\bvec^\perp}\) \(\newcommand{\xhat}{\widehat{\xvec}}\) \(\newcommand{\vhat}{\widehat{\vvec}}\) \(\newcommand{\uhat}{\widehat{\uvec}}\) \(\newcommand{\what}{\widehat{\wvec}}\) \(\newcommand{\Sighat}{\widehat{\Sigma}}\) \(\newcommand{\lt}{<}\) \(\newcommand{\gt}{>}\) \(\newcommand{\amp}{&}\) \(\definecolor{fillinmathshade}{gray}{0.9}\)Metacello is an important part of Pharo. It will allow your project to scale and allows you to control when you want to migrate to a new version and for which packages. It is an important architectural backbone.
Metacello Memento
ConfigurationOfCoolToolSet>>baseline06: spec "could be called differently just a convention" <version: '0.6-baseline'> "Convention. Used in the version: method" spec for: #common do: [ "#common/#pharo/#gemstone/#pharo’1.4’" spec blessing: #baseline. "Important: identifies a baseline" spec repository: 'http://www.example.com/CoolToolSet'. "When we depend on other projects" spec project: 'CoolBrowser default' with: [ spec className: 'ConfigurationOfCoolBrowser'; "Optional if convention followed" versionString: #bleedingEdge; "Optional. Could be #stable/#bleedingEdge/specific version" loads: #('default'); "which packages or groups to load" file: 'CoolBrowser-Metacello'; "Optional when same as class name" repository: 'http://www.example.com/CoolBrowser']; project: 'CoolBrowser Tests' copyFrom: 'CoolBrowser default' "Just to reuse information" with: [ spec loads: #('Tests').]. "Just to reuse information" "Our internal package dependencies" spec package: 'CoolToolSet-Core'; package: 'CoolToolSet-Tests' with: [ spec requires: #('CoolToolSet-Core') ]; package: 'CoolBrowser-Addons' with: [ spec requires: 'CoolBrowser-Core' ] ; package: 'CoolBrowser-AddonsTests' with: [ spec requires: #('CoolBrowser-Addons' 'CoolBrowser-Tests' ) ]. spec group: ’default’ with: #(’CoolBrowser-Core’ ’CoolBrowser-Addons’); group: 'Core' with: #('CoolBrowser-Core'); group: 'Extras' with: #('CoolBrowser-Addon'); group: 'Tests' with: #('CoolBrowser-Tests' 'CoolBrowser-AddonsTests'); group: 'CompleteWithoutTests' with: #('Core' 'Extras'); group: 'CompleteWithTests' with: #('CompleteWithoutTests' 'Tests') ].
ConfigurationOfCoolBrowser>>version07: spec "could be called differently just a convention" <version: '0.7' imports: #('0.6-baseline')> "Convention. No baseline so this is version" "do not import baseline from other baselines" spec for: #common do: [ "#common/#pharo/#gemstone/#pharo’1.4’" spec blessing: #release. "Required #development/#release: release means that it will not change anymore" spec description: 'In this release .....'. spec author: 'JohnLewis'. spec timestamp: '10/12/2009 09:26'. spec package: 'CoolBrowser-Core' with: 'CoolBrowser-Core-BobJones.20'; package: 'CoolBrowser-Tests' with: 'CoolBrowser-Tests-JohnLewis.8'; package: 'CoolBrowser-Addons' with: 'CoolBrowser-Addons-JohnLewis.6' ; package: 'CoolBrowser-AddonsTests' with: 'CoolBrowser-AddonsTests-JohnLewis.1'] ConfigurationOfGemToolsExample>>development: spec "note that the selector can be anything" <symbolicVersion: #development> "#stable/#development/#bleedingEdge" spec for: #common version: '1.0'. "’1.0’ is the version of your development version" "#common or your platform attributes: #gemstone, #pharo, or #’pharo1.4’"
ConfigurationOfGemToolsExample>>baseline10: spec <version: '1.0-baseline'> spec for: #common do: [ spec blessing: #'baseline'. "required see above" spec repository: 'http://seaside.gemstone.com/ss/GLASSClient'. spec project: 'FFI' with: [ spec className: 'ConfigurationOfFFI'; versionString: #bleedingEdge; "Optional. #stable/#development/#bleedingEdge/specific version" repository: 'http://www.squeaksource.com/MetacelloRepository' ]; project: 'OmniBrowser' with: [ spec className: 'ConfigurationOfOmniBrowser'; versionString: #stable; "Optional. #stable/#development/#bleedingEdge/specific version" repository: 'http://www.squeaksource.com/MetacelloRepository' ]; project: 'Shout' with: [ spec className: 'ConfigurationOfShout'; versionString: #stable; repository: 'http://www.squeaksource.com/MetacelloRepository' ]; project: 'HelpSystem' with: [ spec className: 'ConfigurationOfHelpSystem'; versionString: #stable; repository: 'http://www.squeaksource.com/MetacelloRepository']. spec package: 'OB-SUnitGUI' with: [spec requires: #('OmniBrowser')]; package: 'GemTools-Client' with: [ spec requires: #('OmniBrowser' 'FFI' 'Shout' 'OB-SUnitGUI' ).]; package: 'GemTools-Platform' with: [ spec requires: #('GemTools-Client' ). ]; package: 'GemTools-Help' with: [ spec requires: #('HelpSystem' 'GemTools-Client' ). ]. spec group: 'default' with: #('OB-SUnitGUI' 'GemTools-Client' 'GemTools-Platform' 'GemTools-Help')].
ConfigurationOfGemToolsExample>>version10: spec <version: '1.0' imports: #('1.0-baseline' )> spec for: #common do: [ spec blessing: #development. spec description: 'initial development version'. spec author: 'dkh'. spec timestamp: '1/12/2011 12:29'. spec project: 'FFI' with: '1.2'; project: 'OmniBrowser' with: #stable; project: 'Shout' with: #stable; project: 'HelpSystem' with: #stable. spec package: 'OB-SUnitGUI' with: 'OB-SUnitGUI-dkh.52'; package: 'GemTools-Client' with: 'GemTools-Client-NorbertHartl.544'; package: 'GemTools-Platform' with: 'GemTools-Platform.pharo10beta-dkh.5'; package: 'GemTools-Help' with: 'GemTools-Help-DaleHenrichs.24'. ].
Loading. load
, load:
The load
method loads the default group and if there is no default group defined, then all packages are loaded. The load:
method takes as parameter the name of a package, a project, a group, or a collection of those items.
(ConfigurationOfCoolBrowser project version: '0.1') load. (ConfigurationOfCoolBrowser project version: '0.2') load: {'CBrowser-Core' . 'CBrowser- Addons'}.
Debugging. record
, record: loadDirectives
The message record does the record for the default group and if you want a specific group of items, you can use record:
, just as it is for load
.
((ConfigurationOfCoolBrowser project version: '0.2') record: { 'CoolBrowser-Core' . 'CoolBrowser-Addons' }) loadDirective.
If you want to recursively access all the file versions, use packageDirectivesDo:
as in the following example:
| pkgs loader | loader := ((Smalltalk globals at: #ConfigurationOfMoose) project version: 'default') ignoreImage: true; record. pkgs := OrderedCollection new. loader loadDirective packageDirectivesDo: [:directive |pkgs add: directive spec file ]. pkgs.
Proposed development process. Using metacello we suggest the following development steps.
Baseline "first we define a baseline" Version development "Then a version tagged as development" Validate the map "Once it is validated and the project status arrives to the desired status" Version release "We are ready to tag a version as release" Version development "Since development continues we create a new version" ... "Tagged as development. It will be tagged as release and so on" Baseline "When architecture or structure changes, a new baseline will appear" Version development "and the story will continue" Version release