[jQuery] Creating objects for components using jquery

[jQuery] Creating objects for components using jquery


Hi,
I know this is an amatour message but I was wonderig if someone could
point me to the right direction.
with Dojo, you create objects and then you do something like this
var chart = new dojo.charting.Chart(null, "Example chart", "This is
the example chart description");
//Add the plot area at an offset of 10 pixels from the top left
chart.addPlotArea({ x: 10, y: 10, plotArea: chartPlotArea });
//Setup the chart to be added to the DOM on load
dojo.addOnLoad(function()
{
chart.node = dojo.byId("GraphContainerArea");
chart.render();
});
CODE SAMPLE from http://www.ridgway.co.za/archive/2007/04/13/A-Simple-Dojo-Charting-Example.aspx
Well my plan is the following.
I have some COMPONENT based part on my page which I intent to reuse
all over the site.
so I want to create an object and bind it on the id of a div and all
sub elements of that div.
what are the best practices here.
- should I extend jquery , have each component is a plugin ?
- also how would I define my namespace for this ? like
companyname.component.name
Thanks a lot for any hint
Istvan