<div class="gmail_quote"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
&quot;ANComponent userRepository&quot;<br>
userRepository<br>
        TheUserRepository ifNil: [TheUserRepository := GDRepository for: ANUser].<br>
        ^ TheUserRepository<br>
<br>
&quot;ANComponent&gt;&gt;initialize&quot;<br>
initialize<br>
        super initialize.<br>
        userRepository := ANComponent userRepository.<br>
<br>
</blockquote></div><br>I agree with James but I&#39;ll be more specific, how about this...<br><br>
UserRepository class&gt;&gt;forApp: anApp<br>    ^ (Repository ifNil: [Repository := Dictionary new ])<br>        at: anApp ifAbsentPut: [ GDRepository for: ANUser ]<br>            <br>
<br>
ANComponent&gt;&gt;initialize<br>    super initialize.<br>    userRepository := UserRespository forApp: self session baseUrl printString.<br><br>No need to stick the repository on a component class, create a unique class just for it, you get an automatic singleton because classes *are* singletons and why shouldn&#39;t a user repository be its own abstraction?<br>
<br>Ramon Leon<br><a href="http://onsmalltalk.com">http://onsmalltalk.com</a><br>