[Cosmo-dev] Re: [commits-cosmo] (br) [4567] this is a better way not to clobber namespaces.

Matthew Eernisse mde at osafoundation.org
Wed Jun 6 10:18:39 PDT 2007


Nicola,

Sorry you're having some confusion working with the Cosmo UI code. The 
codebase has grown over time from a fairly small prototype to the very 
large amount of code you see now, and the organic growth means sometimes 
things are a bit messy.

Actually, in the 0.6.1, the references to 'Cal' you see in the code 
point to cosmo.ui.cal_main.Cal. You can see the alias at the bottom of 
cosmo/ui/cal_main.js.

When we rolled out Dojo in the UI code, we began converting all of the 
namespacing objects we had in the global namespace (e.g., 'Cal') into a 
more proper namespacing hierarchy based on what directory the different 
files live in. The conversion has taken awhile, and while it was going 
on we aliased the old names like 'Cal' to the newer hierarchical ones to 
avoid breaking things.

In the current Cosmo trunk, the namespacing is much saner -- the aliases 
are all finally gone, and cosmo.ui.cal_main.Cal is now cosmo.app.pim, to 
indicate that the central app is a personal information manager, not 
just a calendar. The only namespace that references 'cal' now is 
cosmo.view.cal.

Hope that helps.


Matthew


Nicola Piccinini wrote:
> IMHO using cosmo.view.cal both for namespace and for the "cal" singleton 
> is awkward. I also had some problems doing odd experiments, shortly I 
> had cal.view.cal.[Lozenge, canvas, dialog, ...] swept out from the 
> namespace.
> I believe that having a separated cosmo.view.cal.Cal name for the "cal" 
> singleton would be less problematic.
> 
> Best regards.
> 
> PS: I always refer to cosmo 0.6.1 base code.
> _______________________________________________
> cosmo-dev mailing list
> cosmo-dev at lists.osafoundation.org
> http://lists.osafoundation.org/mailman/listinfo/cosmo-dev
> 



More information about the cosmo-dev mailing list