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

Simplification #8

Closed
dkleehammer opened this issue Nov 14, 2014 · 1 comment
Closed

Simplification #8

dkleehammer opened this issue Nov 14, 2014 · 1 comment

Comments

@dkleehammer
Copy link
Owner

Package should be simplified to give a module back that is a singleton or a factory. This will make the package much smaller, but provide the same functionality as the original carbon that I planned.

Reasons for change:

  1. Since all modules where stored in the exports object (node global or window global), it doesn't make any storage difference and naming conventions can still contain '.', e.g. 'Util.Logger'. The injection process will appear the same to the developer.
  2. Too hard to explain what service and factories are in this project and the difference between carbon and other libs/frameworks. Angular messed up the meaning of a factory in programming, at least as far as I'm concerned. Angular's factory returns the same singleton and is not a factory in my opinion, it's just a wrapper to do some pre-conditioning to the service about to be created. Also, Angular has providers, factories and services, which are all providers, but are also listed as services. To clarify, carbon's 'factory' modules are new instances each time, where the singletons are the exact same instance each time the developer uses/injects it.
  3. Carbon file size was too large. Seeing that the system provides DI for testing and code maintainability, I was wondering why the minified version was nearly 2K. Trimming the fat from modules containing services and factories to returning just modules that are singletons or factories (carbon's version) shrunk the file size down to ~600 bytes. We are just the beginning tool that binds the rest of the code together, hence, then carbon name... that and Atom was taken by github.
@dkleehammer
Copy link
Owner Author

Fixed in pull request.

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

1 participant