0

I have an DatesService which responsible for manipulate dates. Also I have two services who need to use date manipulation - EventsService and CalendarService. CalendarService use EventsService.

My question is: what is better (performance and everything else) - include DatesService in both services, or in CalendarService call DatesService through EventsService in this way: this.eventsService.datesService?

1 Answer 1

1

We faced a similar "problem" and we decided to create a central provider service that contains many other services that are frequently used.

It does not make a difference performance-wise, but it is more convenient to inject only one service instead of several. It keeps the code clean and refactoring is easier.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.