Moving project’s components/services into packages (the separation of concerns)

Written by shystruk | Published 2018/04/11
Tech Story Tags: javascript | front-end-development | programming | web-development | npm

TLDRvia the TL;DR App

Component-based software engineering (CBSE), also called as component-based development (CBD), is a branch of software engineering that emphasizes the separation of concerns with respect to the wide-ranging functionality available throughout a given software system.

In this day’s Component-Based Architecture is highly popular, each modern UI framework provides component structure approach. Check out this article for pros and cons. What I like the most in CBA is the separation of concerns😎

Whether starting a small project or having a huge one the separation of concerns is going to be a key point for easy maintenance, testability, reusability. If you are UI engineer you should have probably heard about npm package manager. This is a good way to move your reusable components, services there.

Why should I do that? ☝️1. easy to share between teams2. integration in one line - import package from ‘package’3. maintenance 4. testing5. semantic versioning6. private or public (community may help to improve)

If you want to have a private packages it is also possible.

As an example you may check this project.

create-react-redux-app-structure_create react redux app structure with build configurations_www.npmjs.com

In Dependencies list it has 4 public packages which were checked by open source community and improved 👌 (no-internet, publish-subscribe-js, set-interval, famulus).

How to create npm package?

Check out official doc. Rollup (module bundler for JavaScript) may help you to create a new standardized format for code modules included in the ES6 revision of JavaScript.

In addition, to the separation of concerns, I would like to mention “Pattern library” as a way to collect user interface design elements. Check out this article for more understanding 💪

Some thoughts are here and there:

👏 Thank you for reading. Suggestions, comments, thoughts are welcome 👍

If you like this, clap, follow me on medium, twitter, github share with your friends 😎


Published by HackerNoon on 2018/04/11