Re: Spring Modules?
Posted: 15 Sep 2013, 22:32
Thanks for all the posts guys.
I'll try to write a summary on what I feel the consensus is here.
1. What should be separated into modules?
Most people seem to agree that frameworks and libraries should be separated from the game in which they are used, and the most cited example is chili. It seems there's no agreement on whether any widgets or game mechanics should be made into modules and in what degree.
2. Why do the separation in the first place?
The main reason is probably the ability to reuse the module in multiple projects (usually different games). Other than that people may want to have a more modular design because it would enforce a higher separation of components which tends to result in higher maintainability. Nothing that makes Spring special here I think.
3. How should the separation happen?
There's no single best answer here, but there a couple of choices. All of them follow the assumption that modules have their own, separate place of development, usually a VCS repository, and if that's not done, then they really can't be reused elsewhere reliably.
List of choices:
A: Copying the module files & folders to your game. This is what most games seem to do (correct me if I'm wrong). Pros: easy to setup, extend and distribute the final product . Cons: hard to be updated with upstream and hard to contribute any game-agnostic changes back to upstream
B: Including the module via Spring modules method as originally proposed in this thread. This is rarely done currently (only in the case of Spring Features or Spring Cursors that I know of). Pros: easy to setup, get updates from upstream and distribute; distributed games are smaller Cons: hard to modify modules (many would need to be changed with that intent in mind).
C: VCS support (git has submodules) that can manage modules. I haven't looked into many projects' repositories, so the only example I know of is my ToolBox repo: https://github.com/gajop/Toolbox/tree/master/libs. Pros: easy to update, modify, sync with upstream. Cons: higly depends on your VCS, can be hard to setup (if upstream is not on the same VCS type), modules must be kept in separate directories.
D: Package tool that AF suggests. Still not 100% sure how this would work, so rather than speculating ill ask a few questions. From what I understand you would do a 'springpackager install' before working on anything, which would grab the specified versions of the dependencies and put them in your project directory.
How would you then modify and later update these dependencies to suit your project's needs?
Also, if you don't intend to change the modules, I don't see the benefit of having one large Spring module (game) instead of separating it in multiple modules (with one game module that includes them). You can have multiple versions of the same module on the same machine, and it usually even means a much smaller download size on updates (when using rapid).
I'll try to write a summary on what I feel the consensus is here.
1. What should be separated into modules?
Most people seem to agree that frameworks and libraries should be separated from the game in which they are used, and the most cited example is chili. It seems there's no agreement on whether any widgets or game mechanics should be made into modules and in what degree.
2. Why do the separation in the first place?
The main reason is probably the ability to reuse the module in multiple projects (usually different games). Other than that people may want to have a more modular design because it would enforce a higher separation of components which tends to result in higher maintainability. Nothing that makes Spring special here I think.
3. How should the separation happen?
There's no single best answer here, but there a couple of choices. All of them follow the assumption that modules have their own, separate place of development, usually a VCS repository, and if that's not done, then they really can't be reused elsewhere reliably.
List of choices:
A: Copying the module files & folders to your game. This is what most games seem to do (correct me if I'm wrong). Pros: easy to setup, extend and distribute the final product . Cons: hard to be updated with upstream and hard to contribute any game-agnostic changes back to upstream
B: Including the module via Spring modules method as originally proposed in this thread. This is rarely done currently (only in the case of Spring Features or Spring Cursors that I know of). Pros: easy to setup, get updates from upstream and distribute; distributed games are smaller Cons: hard to modify modules (many would need to be changed with that intent in mind).
C: VCS support (git has submodules) that can manage modules. I haven't looked into many projects' repositories, so the only example I know of is my ToolBox repo: https://github.com/gajop/Toolbox/tree/master/libs. Pros: easy to update, modify, sync with upstream. Cons: higly depends on your VCS, can be hard to setup (if upstream is not on the same VCS type), modules must be kept in separate directories.
D: Package tool that AF suggests. Still not 100% sure how this would work, so rather than speculating ill ask a few questions. From what I understand you would do a 'springpackager install' before working on anything, which would grab the specified versions of the dependencies and put them in your project directory.
How would you then modify and later update these dependencies to suit your project's needs?
Also, if you don't intend to change the modules, I don't see the benefit of having one large Spring module (game) instead of separating it in multiple modules (with one game module that includes them). You can have multiple versions of the same module on the same machine, and it usually even means a much smaller download size on updates (when using rapid).