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

The ISL-R Design Pattern (MVC is dead, long live MVC) #33

Open
coolaj86 opened this issue Jul 29, 2022 · 0 comments
Open

The ISL-R Design Pattern (MVC is dead, long live MVC) #33

coolaj86 opened this issue Jul 29, 2022 · 0 comments

Comments

@coolaj86
Copy link
Collaborator

coolaj86 commented Jul 29, 2022

Re:

The ISL-R design pattern is a component-oriented rehash of MVC (MVVM, MVP), but with more practical (less computer-sciencey) naming.

A component (or package or module) can be thought of as parts:

  • Interaction (parsing arguments, query, etc)
  • Shape (typeable adaptation of storage)
  • Logic (testable, valuable logic)
  • and Routing (index of capabilities)

Component Architecture

As opposed to category architecture.

Meaning "all the stuff related to widgets goes together, and all of the stuff related to gizmos goes together" instead of "all the stuff related to data storage goes together".

Grouping things by how they could be exported as a small, independent unit.

❌ Not this

foobar5000/
├── models/
│  ├── gizmos.db
│  └── widgets.db
├── views/
│  ├── gizmos.fml
│  └── widgets.fml
└── controllers/
   ├── gizmos.app

✅ This

./lib/gizmos.js:

Gizmos.data.getUpsideDownGizmos = async function () {
  // ...
};

Gizmos.lib.calculateAveragePrice = function (gizmos) {
  // ...
};

Gizmos.json.showAverageCost = function (req, res) {
  let gizmos = await Gizmos.data.getUpsideDownGizmos();
  let average = Gizmos.lib.calculateAveragePrice(gizmos);
  res.json({ average });
};

router.js:

router.get(
  "/api/gizmos/average-cost",
  Gizmos.json.showAverageCost
);

Interaction

Separating the bits that handle how a user (developer, machine, or product customer) interacts with the system from the unique, valuable work (business logic).

Shape

TODO

Logic

TODO

Routing

TODO

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

No branches or pull requests

1 participant