Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modules patterns #28

Open
jamesplease opened this issue Jun 16, 2014 · 2 comments
Open

Modules patterns #28

jamesplease opened this issue Jun 16, 2014 · 2 comments

Comments

@jamesplease
Copy link
Member

From what I can tell there are two patterns for using v1.x-2.x modules for application architecture, and it stems from whether you use Modules as obj. lits or anonymous fn.

In the object literal format, you use them as lifecycle objects that store your other objects. Often they're tied to routes and views.

In the anonymous function definition you use them as namespaces; sort of a stand in for AMD or CommonJS modules. It gives you encapsulation and a means to access any module.

Brian Mann is a proponent of the anonymous fn definition. I use the obj lit format.

@Anachron
Copy link

I'm not quite sure if it's good to keep with modules, there are now module formats that work everywhere, like uRequire. As for my taste, this is a good way for future managing your application dependencies.

Also small heads up, I like the change from modules into subapps and I hope to see some more thoughts about it. In my mind I have some sort of shared Bus between the apps which make them even more separate while on the same time forcing good patterns.

@jamesplease
Copy link
Member Author

heh yup @Anachron we support not using Marionette modules as a replacement for real modules, like Amd or CommonJS. But we also think that Marionette Modules can be used for a different purpose entirely, despite the similar name. It's just happenstance that they share the same name. We might instead just make everything Applications in v3 to clear up the confusion. But those are decisions for the future :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants