DEV Community

Discussion on: Scalable Angular Architecture

Collapse
 
hanss profile image
Hans Schenker

Question: Could a Service be taken for the FacadeApi. Every CRUD-Business Use case is handled in the service (sample: EmployeeService = EmployeeApi)

Collapse
 
bartosz_io profile image
Bartosz Pietrucha

The purpose of Facade is to abstract away business logic (core layer) from presentation layer. When you say EmployeeService it could do almost everything around Employee (transformation, validation, etc) and EmployeeApi has very well defined purpose - purely fetch data from API (whatever it is REST, GraphQL, WebRTC) and give you back an Observable. Separation of concerns and Single responsibly principle are key aspects for scalable and reliable software.