-
Notifications
You must be signed in to change notification settings - Fork 14
CWG 2023 08 15
The Herbs core working group met again. Here's what went down, complete with exciting updates, new features, and bug fixes!
- David Lojudice
- Vitor Araujo (Vórtx)
- Rodolfo Silva (Infleet)
- Friends from Vórtx
- Refactoring of Herbs2Mermaid is in progress to handle more complex use cases.
- Others small visual improvements: Use case operation tag, step type tag, etc.
- Now integrated into the CLI
new
command.
-
Graph: Herbarium has been evolving to be the information center of the project. It's possible to find all domain objects there, like entities, use cases, specs, etc. Also all metadata for this objects too. Now we are evolving Herbarium from a object repository to a object graph.
-
Nodes: A new generic interface will allow any object to be added to Herbarium.
herbarium.nodes.add(nodeId, nodeType, nodeMetadata)
-
Links: To facilitate linking between objects using metadata, a new method
.link('User')
has been created.// CreateProduct Use Case module.exports = herbarium.nodes .add('CreateProduct', createProduct, herbarium.node.usecase) .metadata({ operation: herbarium.crud.create }) .link('Product') .value
-
Having Herbarium as a graph database allows us to create a new version of Herbs2REST that will be able to generate endpoints based on the use cases and the links between them.
// 1. Create endpoints based on the use cases endpoints({ herbarium, controller }, { 'v1': (endpoints) => { endpoints.ignore('FindUser') // no endpoint for this use case endpoints.for('CancelCustomerSubscription').use({ // endpoint for this use case with extra configuration method: 'PUT', path: '/v1/customerSubscriptions/:id/cancel', parameters: { params: { id: String } }, }) endpoints.build() // build endpoints for all other use cases }, 'v2': (endpoints) => { endpoints.ignore('FindUser') endpoints.ignore('CancelCustomerSubscription') endpoints.build() } }) // 2. Generate the endpoints routes({ herbarium, server }).attach()
The previous version the link between the use case and the endpoint was made by the use case metadata
REST
. It will no longer be necessary.The new interface will (1) find the use case, (2) create a new Endpoint object for it with the values passed on the
use
method and (3) link the endpoint to the use case on Herbarium.For all other use cases that does not have extra configuration, the endpoints will be created automatically by the
build
method.At the end, all use cases will have a corresponding endpoint object on Herbarium and linked to the use case.
The
endpoints
object will populate endpoints and links on herbarium. Theroutes
object will use the herbarium to generate the routes on the Express server.
- Vitor has advanced the Herbs2Mongo to support nested entities and arrays, although it's not ready for deployment due to certain corner cases.
A huge shoutout to everyone involved in the meeting! Your hard work and dedication are shaping the future of Herbs. Stay tuned for more updates and exciting developments! 🌿🌟
The meeting was recorded, and the link will be released as soon as it's available.