mardi 12 septembre 2023

Angular related Architectural decision

Architectural decision

I am currently developing an Angular application and facing a crucial architectural decision. To provide you with more context, let's consider that I have three main components: "education," "education-item," and "education-form."

enter image description here

Architectural components

Education-Form

The "education-form" component is responsible for gathering all the necessary information related to a user's education record. This component is triggered when a user clicks the "Add Education Record" button within the "education" component.

Education-Item

The "education-item" component represents an individual education record. It features two buttons for editing and removing education records.

Education

The "education" component serves as the page where all education items are displayed and includes an "Add" button, which reveals the "education-form" component for adding a new education record.

Upon analyzing these three components, it becomes evident that they all require access to a list of education records. This list is essentially the central element that undergoes continuous modification throughout the application's operation.

Component Roles / Usage
education-form adds education records to the list
education-item edits or removes elements from the list
education displays the list using the "education-item"

Services

Education-Service

The "educationService" will manage this list of education records. This service provides methods for adding, updating, deleting, and retrieving records and is injected into all three components. Note that this data is persisted in the backend.

Api-Education-Service

The "api-education-service" is responsible for the communication with the backend and provides methods for creating, updating, deleting, and listing education records. This service is injected into the "educationService". An example of his usage is the "add" method of the "educationService", this adds a record to the list in "educationService" and calls the "create" method of the "api-education-service".

Is this design proposal of an Angular based application future-proof, or do you see any side effects, problems or improvement that could be added ?

I will be happy to discuss it with you guys. Thanks for sharing your thoughts!!!

Aucun commentaire:

Enregistrer un commentaire