Structure the code

130 views
Skip to first unread message

nach...@gmail.com

unread,
Apr 2, 2012, 3:13:30 PM4/2/12
to closure-lib...@googlegroups.com
Hello, I am need to develop big web app just with javascript and I am completely new in this. I have chosen to do it with google closure and I´d like to know ideas on how to structure the code for an scalabe app, and which modules are common in this projects(event handling?). Should I follow a model,view, controller pattern??
Any reading resources, or examples?? Is there a library or something to force me do it in a good way??
Thank you guys for your ideas

Brian Kotek

unread,
Apr 3, 2012, 8:23:58 AM4/3/12
to closure-lib...@googlegroups.com

nach...@gmail.com

unread,
Apr 3, 2012, 12:18:11 PM4/3/12
to closure-lib...@googlegroups.com
Yes I am actually reading it, I didn´t know that it talks about this. Then I guess I have to wait to get to this part.
Thanks

maggie....@gmail.com

unread,
Apr 3, 2012, 12:47:07 PM4/3/12
to closure-lib...@googlegroups.com
Hi Nach,

I've just started doing the same. I'm starting to write up a tutorial/blog which should go over some concepts and ways to use the closure set of tools to build web applications. The blog is on http://rhysbrettbowen.com. I've only just started it but I'm going to try and do a post per day to get some good content on it in the next month or so. 

I've written an MVC, you should definitely use the pattern even if you don't use my framework. You can find it on https://github.com/rhysbrettbowen/goog.mvc, there is a bit of documentation there which should hopefully be enough to get you started, and some tests - though I need to go through and write more. It's nearing v1 and all should be buttoned down in the next week or two.

Folder structure can also be important. At the moment I'm splitting up in to 3 files: js, styles & templates. So the GSS goes in styles and my soy templates go in to templates. I've also got a folder called strings under templates which I use for translatable strings in the templates. Under js I've got app which I use for the main file and other classes that the whole program can access (like the mediator), api which is for communication with servers, control for all the controls, models for the models with two subfolders: sync for the model syncs and schema where I hold the schemas for the models. And last I've got a ui folder where I put in the ui.components for the page and areas not associated with a model with a subfolder of widget where I keep reusable UI bits (things like image gallery or customized text editor).

If you just stay tuned to the blog I should start diving in to the MVC library probably on friday and try to show good patterns of how to use it. If there are any questions just ask - I'm always happy to get a bit of input to improve what is there.

maggie....@gmail.com

unread,
Apr 3, 2012, 12:50:14 PM4/3/12
to closure-lib...@googlegroups.com
forgot to mention the lib folder under js which is where I keep the mvc and https://github.com/rhysbrettbowen/G-closure which I use so I have a jquery like interface to the library


On Monday, April 2, 2012 12:13:30 PM UTC-7, nach...@gmail.com wrote:

Nicolas Rannou

unread,
Apr 3, 2012, 3:26:47 PM4/3/12
to closure-lib...@googlegroups.com
I bought it but was a bit disappointed since it is a bit old, many things are not up to date but it is still a good investment I guess.

Ilia Mirkin

unread,
Apr 3, 2012, 5:30:12 PM4/3/12
to closure-lib...@googlegroups.com
You might also look at the relief framework. I haven't used it in any
real projects, but playing around with it, it seemed to have some nice
concepts baked in. http://code.google.com/p/relief/

On Mon, Apr 2, 2012 at 3:13 PM, <nach...@gmail.com> wrote:

Reply all
Reply to author
Forward
0 new messages