Directory structure for Particles

19 views
Skip to first unread message

Nicolai Kamenzky

unread,
Apr 1, 2014, 6:50:50 PM4/1/14
to parti...@googlegroups.com
Hi Mario and everyone else,

I am excited about Scatter and want to use it in my new project.

I read the available documentation and got the understanding that I will have for each particle:
  • One folder
  • One particle.json
  • One JavaScript source file
Is that always the case? Could I do for example:
  1. Put more that one Particle JavaScript source file into the same folder with just one particle.json for all of them? Maybe by configuring subparticles?
  2. Put additional JavaScript source files into the folder which I require (regular Node.js style) e.g. for helper functions? (Just to split up a bigger particle.)
Thanks for your feedback!
Nicolai

Mario Casciaro

unread,
Jun 20, 2014, 3:39:55 AM6/20/14
to parti...@googlegroups.com
Hi Nicolai,
sorry if I'm late with the answer, but I didn't get notified for this post.
To answer your questions:

A particle has one root folder, one particles.json file but as many source files and subdirectories you want. The folders of all the particles will be virtually "merged" into one by the Scatter IoC container. 
At the moment the "directory require" does not work as it would when using the normal "require()", at the end we should always keep in mind that Scatter is NOT the same as using require(), it uses its own resolving algorithm, the current way of loading module is only a convenience for intuitively loading dependencies using a known and familiar format (the one used by require()). 

Please do not hesitate to ask other questions if you have any other doubt.

Nicolai Kamenzky

unread,
Jul 11, 2014, 4:21:00 PM7/11/14
to parti...@googlegroups.com
Hi Mario,

thanks for your answer. Unfortunately, I already implemented my own di container in the meantime.
I was just asked to state its differences to Scatter. Maybe you wanna add a comment from your perspective so it is not too one-sided.

Cheers,
Nicolai
Reply all
Reply to author
Forward
0 new messages