[Cosmo-dev] Refactor of cal_main.js

Matthew Eernisse mde at osafoundation.org
Mon Aug 14 11:09:40 PDT 2006


Bobby Rullo wrote:
 > Could you explain what this list means a little more? That is, are these
 > separate files? Functions? Classes? Equally important is how they
 > interact with each other - like "The GUI widget contains a foo bar
 > service which is uses static functions in the BarUtils.js to do it's
 > bar-processing"

Initially at least, I mainly just want to get the increasingly 
monolithic Cal object in cal_main.js broken up (before it develops its 
own gravitational field). I'm really just aiming at getting some logical 
subdivisions in the existing code -- but hopefully what we come up with 
will get us to something resembling a roadmap for evolving the codebase 
toward the more decentralized set of objects and object interactions 
that we want.

The following are JS objects (namespaces). For 'app' you want want to 
think 'cosmo,' 'pim,' 'usedToBeScooby' or what have you. It's basically 
the top-level object, to keep our stuff out of the global namespace.

app.ui
   * GUI container-elem init
   * Rendering base UI elem

app.ui.lang
Lang-specific resource init

app.ui.dialog
Dialog box (error, remove, etc.)

app.dataAccess (storage?)
Loading items (events) from service

app.timeout
Timeout/keepalive

app.view.cal
   * Save/remove events (deprecate)
   * Navigation / cal-switching
   * Scoob-specific date-calc funcs

app.view.cal.canvas
   * Appending events on canvas
   * ID/datetime extraction (deprecate)
   * Time/position calculations on canvas

app.view.cal.conflict
Event conflict calculations

Again, the initial work I want to do is just migrating the existing code 
in cal_main.js into these different subdivisions -- although there may 
be some low-hanging fruit to pluck WRT to making architectural changes 
as well.


Matthew






More information about the cosmo-dev mailing list