-
Notifications
You must be signed in to change notification settings - Fork 102
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
Design Proposal: Modularize AngularJS Service Creation #214
Comments
This is called inheritance (heritage) in OOP paradigm, it is good to make our code clean and easy to read and very rich in terms of design. But it will also help us to save time in development because CRUD operation code will be factorized since it is common to many services. I service will contain only method which are very specific to him. I am okay with that for conceptual perceptive and best practice. Thanks |
@DedrickEnc , thanks for the feedback! We'll look at developing a PR that refactors a lot of the services when they are more stable. |
This commit implements PrototypeApiService to remove boilerplate code from our services and improve code documentation. To demonstrate how the PrototypeApiService works, the FiscalService has been created to inherit directly from it. The CashPayments service also is updated to inherit from the PrototypeApiService. This also increments mocha's versioning since the recent bug fix. Finally, a bug with the bhCurrencySelect has been fixed. Closes #214.
This commit implements PrototypeApiService to remove boilerplate code from our services and improve code documentation. To demonstrate how the PrototypeApiService works, the FiscalService has been created to inherit directly from it. The CashPayments service also is updated to inherit from the PrototypeApiService. This also increments mocha's versioning since the recent bug fix. Finally, a bug with the bhCurrencySelect has been fixed. Closes #214.
This commit implements PrototypeApiService to remove boilerplate code from our services and improve code documentation. To demonstrate how the PrototypeApiService works, the FiscalService has been created to inherit directly from it. The CashPayments service also is updated to inherit from the PrototypeApiService. This also increments mocha's versioning since the recent bug fix. Finally, a bug with the bhCurrencySelect has been fixed. Closes #214.
This commit implements PrototypeApiService to remove boilerplate code from our services and improve code documentation. To demonstrate how the PrototypeApiService works, the FiscalService has been created to inherit directly from it. The CashPayments service also is updated to inherit from the PrototypeApiService. This also increments mocha's versioning since the recent bug fix. Finally, a bug with the bhCurrencySelect has been fixed. Closes #214.
This commit implements PrototypeApiService to remove boilerplate code from our services and improve code documentation. To demonstrate how the PrototypeApiService works, the FiscalService has been created to inherit directly from it. The CashPayments service also is updated to inherit from the PrototypeApiService. This also increments mocha's versioning since the recent bug fix. Finally, a bug with the bhCurrencySelect has been fixed. Closes #214.
This commit implements PrototypeApiService to remove boilerplate code from our services and improve code documentation. To demonstrate how the PrototypeApiService works, the FiscalService has been created to inherit directly from it. The CashPayments service also is updated to inherit from the PrototypeApiService. This also increments mocha's versioning since the recent bug fix. Finally, a bug with the bhCurrencySelect has been fixed. Closes #214.
This commit implements PrototypeApiService to remove boilerplate code from our services and improve code documentation. To demonstrate how the PrototypeApiService works, the FiscalService has been created to inherit directly from it. The CashPayments service also is updated to inherit from the PrototypeApiService. This also increments mocha's versioning since the recent bug fix. Finally, a bug with the bhCurrencySelect has been fixed. Closes #214.
This commit implements PrototypeApiService to remove boilerplate code from our services and improve code documentation. To demonstrate how the PrototypeApiService works, the FiscalService has been created to inherit directly from it. The CashPayments service also is updated to inherit from the PrototypeApiService. This also increments mocha's versioning since the recent bug fix. Finally, a bug with the bhCurrencySelect has been fixed. Closes #214.
This commit version bumps the versions of protractor, dotenv, and ui-grid. It also ensures Travis CI only tests on relevant NodeJS versions. Closes #214.
This commit version bumps the versions of protractor, dotenv, and ui-grid. It also ensures Travis CI only tests on relevant NodeJS versions. Closes #214.
This commit version bumps the versions of protractor, dotenv, and ui-grid. It also ensures Travis CI only tests on relevant NodeJS versions. Closes #214.
This commit version bumps the versions of protractor, dotenv, and ui-grid. It also ensures Travis CI only tests on relevant NodeJS versions. Closes #214.
This commit version bumps the versions of protractor, dotenv, and ui-grid. It also ensures Travis CI only tests on relevant NodeJS versions. Closes #214.
This commit version bumps the versions of protractor, dotenv, and ui-grid. It also ensures Travis CI only tests on relevant NodeJS versions. Closes #214.
3167: Update snyk to the latest version 🚀 r=jniles a=greenkeeper[bot] ## Version **1.95.3** of **snyk** was just published. <table> <tr> <th align=left> Dependency </th> <td> <a target=_blank href=https://github.com/snyk/snyk>snyk</a> </td> </tr> <tr> <th align=left> Current Version </th> <td> 1.95.1 </td> </tr> <tr> <th align=left> Type </th> <td> dependency </td> </tr> </table> The version **1.95.3** is **not covered** by your **current version range**. If you don’t accept this pull request, your project will work just like it did before. However, you might be missing out on a bunch of new features, fixes and/or performance improvements from the dependency update. It might be worth looking into these changes and trying to get this project onto the latest version of snyk. If you have a solid test suite and good coverage, a passing build is a strong indicator that you can take advantage of these changes directly by merging the proposed change into your project. If the build fails or you don’t have such unconditional trust in your tests, this branch is a great starting point for you to work on the update. --- <details> <summary>Release Notes</summary> <strong>v1.95.3</strong> <h2><a href="https://urls.greenkeeper.io/snyk/snyk/compare/v1.95.2...v1.95.3">1.95.3</a> (2018-09-09)</h2> <h3>Bug Fixes</h3> <ul> <li>allow silent clearing of non-existent spinner labels (<a href="https://urls.greenkeeper.io/snyk/snyk/commit/fa520a3">fa520a3</a>)</li> <li>better readability on monitor output (<a href="https://urls.greenkeeper.io/snyk/snyk/commit/f455f65">f455f65</a>)</li> <li>exit code 1 on snyk monitor failure (<a href="https://urls.greenkeeper.io/snyk/snyk/commit/1a30329">1a30329</a>)</li> </ul> </details> <details> <summary>Commits</summary> <p>The new version differs by 6 commits.</p> <ul> <li><a href="https://urls.greenkeeper.io/snyk/snyk/commit/4a20b1d23eb0484c4865df71215ed676d351bed4"><code>4a20b1d</code></a> <code>Merge pull request #215 from snyk/feat/exit-code-1-on-monitor-failure</code></li> <li><a href="https://urls.greenkeeper.io/snyk/snyk/commit/f455f65c3931c01d63b374eeaa237d827857236b"><code>f455f65</code></a> <code>fix: better readability on monitor output</code></li> <li><a href="https://urls.greenkeeper.io/snyk/snyk/commit/1a303298259a41e4506bfd758516785efd46fb2b"><code>1a30329</code></a> <code>fix: exit code 1 on snyk monitor failure</code></li> <li><a href="https://urls.greenkeeper.io/snyk/snyk/commit/fa520a3b2936046a38b199421449b7b2f3b12dfb"><code>fa520a3</code></a> <code>fix: allow silent clearing of non-existent spinner labels</code></li> <li><a href="https://urls.greenkeeper.io/snyk/snyk/commit/fb1d018734cec7c06b143ca8e477e6b23f488306"><code>fb1d018</code></a> <code>Merge pull request #214 from snyk/fix/clear-spinner-on-errors</code></li> <li><a href="https://urls.greenkeeper.io/snyk/snyk/commit/6f0f37fb391b273ee9851fb482bf04bcc9cd88cf"><code>6f0f37f</code></a> <code>fix: clear spinner labels on errors</code></li> </ul> <p>See the <a href="https://urls.greenkeeper.io/snyk/snyk/compare/f65072913187d8e34d6fb9ceaae1f7dc576cef39...4a20b1d23eb0484c4865df71215ed676d351bed4">full diff</a></p> </details> <details> <summary>FAQ and help</summary> There is a collection of [frequently asked questions](https://greenkeeper.io/faq.html). If those don’t help, you can always [ask the humans behind Greenkeeper](https://github.com/greenkeeperio/greenkeeper/issues/new). </details> --- Your [Greenkeeper](https://greenkeeper.io) bot 🌴 Co-authored-by: greenkeeper[bot] <greenkeeper[bot]@users.noreply.github.com>
The majority of our client-side services implement CRUD on the backend database using HTTP verbs against a single API route. Almost every single service implements their
read()
anddelete()
methods identically. In general, they look like this:Since we have many services, this results in a lot of repeated code. This means more code to send to the client (larger JS payload) and maintain as a development team.
Here's an idea I'd like feedback on for maintaining this code more easily. We should simply inherit the identical methods from a prototype service using the awesome power of
angular.extend()
. For example, here is how you might create the prototype service and use it to create several services:If we have close to one service per database API, this will get very large, very quickly. Modularizing our code like this might be a good idea.
@IMA-WorldHealth/local-contributors what do you think?
The text was updated successfully, but these errors were encountered: