<div dir="ltr">Apologizes, for POO in javascript, I did not want to talk about encapsulation, but about fields visibilty (public/protected/private).<div>I've read the mozilla page link that Manuel gave me, but they don't talk about that OOP feature.</div>
<div><br></div><div>And I know that a field declared with 'var' rather than 'this' is private, but only visible in the function where it has been defined (commonly the class constructor) : so it seems to me less flexible that Java approch. And that is because I want to use a framework.</div>
<div><br></div><div>Unfortunately, Dojo ... is heavy in size (around 3Mb). And I can't afford relying on this weight.</div><div>So I keep looking for a better solution.</div><div><br></div><div>Regards.</div></div><div class="gmail_extra">
<br><br><div class="gmail_quote">2013/10/3 Manuel Quiñones <span dir="ltr"><<a href="mailto:manuq@laptop.org" target="_blank">manuq@laptop.org</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
2013/10/2 laurent bernabe <<a href="mailto:laurent.bernabe@gmail.com">laurent.bernabe@gmail.com</a>>:<br>
> Hi,<br>
><br>
> Has anyone tried to use the DojoToolkit in a web activity ?<br>
> Because, as the documentation says that it should be used in a web server.<br>
> Otherwise some functionnalities may not be available.<br>
<br>
What do you want to archive?  I don't know Dojo, but acoording to<br>
their website there are independient modules that are AMD-ready, so<br>
you might be able to use them.  See our docs:<br>
<br>
<a href="http://developer.sugarlabs.org/activity.md.html#using%20other%20javascript%20libraries" target="_blank">http://developer.sugarlabs.org/activity.md.html#using%20other%20javascript%20libraries</a><br>
<br>
> So, is using DojoToolkit safe inside a sugar web activity ?<br>
> Otherwise, I'll look for another javascript POO library. (Prototype.js is<br>
> not fine according to me : too similar to normal javascript).<br>
<br>
You want to archive object oriented programming? You can do it in<br>
straight JavaScript.  The Mozilla documentation is nice:<br>
<br>
<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Introduction_to_Object-Oriented_JavaScript" target="_blank">https://developer.mozilla.org/en-US/docs/Web/JavaScript/Introduction_to_Object-Oriented_JavaScript</a><br>

<br>
If you still feel very unconfortable with JS, you could try other<br>
languages that compile to JS.  See <a href="http://altjs.org/" target="_blank">http://altjs.org/</a> .  Note that this<br>
adds some complexity and the compilation step.  Some that I have tried<br>
are CoffeScript (in Gears activity) and TypeScript.  And one I'm<br>
looking at lately with attention is ClojureScript.<br>
<span class="HOEnZb"><font color="#888888"><br>
--<br>
.. manuq ..<br>
</font></span></blockquote></div><br></div>