Service Layer Abstraction Patterns for Decoupled REST Consumption in Angular Applications

Main Article Content

Harshika Juvvadi

Abstract

Angular applications of nontrivial scale routinely depend on communication with one or more backend REST services, and the manner in which that communication is organized within the application's service layer carries substantial consequences for maintainability, testability, and resilience to backend interface change. This article presents a systematic examination of service layer abstraction patterns applicable to decoupled REST consumption within Angular applications, addressing the layered architecture principles that motivate separating backend communication from component logic, the repository pattern as a mechanism for encapsulating resource specific REST access, data transfer object mapping as a boundary between backend representation and domain model, and the facade pattern as a means of composing multiple underlying services behind a simplified, business oriented interface. The study further examines interceptor based handling of cross cutting communication concerns, RxJS operator composition for response transformation and caching, dependency inversion through injection tokens as a mechanism for substituting alternate service implementations, and the testing strategies that a well decoupled service layer enables. The findings indicate that disciplined application of these abstraction patterns yields an Angular service layer considerably more resilient to backend interface evolution, and considerably more amenable to isolated testing, than an undifferentiated approach in which components interact with the HTTP client directly.

Article Details

Section

Articles

How to Cite

Service Layer Abstraction Patterns for Decoupled REST Consumption in Angular Applications. (2021). International Journal of Research Publications in Engineering, Technology and Management (IJRPETM), 4(4), 5285-5296. https://doi.org/10.15662/IJRPETM.2021.0404006

References

1. Fowler, M. Patterns of Enterprise Application Architecture. Addison Wesley, 2002.

2. Gamma, E., Helm, R., Johnson, R., and Vlissides, J. Design Patterns: Elements of Reusable Object Oriented Software. Addison Wesley, 1994.

3. Martin, R. C. The Dependency Inversion Principle. C++ Report, 1996.

4. Martin, R. C. Agile Software Development: Principles, Patterns, and Practices. Prentice Hall, 2002.

5. Newman, S. Building Microservices: Designing Fine Grained Systems. O'Reilly Media, 2015.

6. Fielding, R. T. Architectural Styles and the Design of Network Based Software Architectures. Doctoral Dissertation, University of California, Irvine, 2000.

7. Fielding, R. T., and Taylor, R. N. Principled Design of the Modern Web Architecture. ACM Transactions on Internet Technology, 2002.

8. Nygard, M. T. Release It! Design and Deploy Production Ready Software. Pragmatic Bookshelf, 2007.

9. Mansilla, S. Reactive Programming with RxJS. Pragmatic Bookshelf, 2015.

10. Daniels, P., and Atencio, L. RxJS in Action. Manning Publications, 2017.

11. Freeman, A. Pro Angular 6. Third Edition, Apress, 2018.

12. Fain, Y., and Moiseev, A. Angular Development with TypeScript. Second Edition, Manning Publications, 2018.

13. Papa, J. Angular Style Guide. Self published developer reference, 2019.

14. Meszaros, G. xUnit Test Patterns: Refactoring Test Code. Addison Wesley, 2007.

15. McConnell, S. Code Complete. Second Edition, Microsoft Press, 2004.

16. European Computer Manufacturers Association International. ECMAScript 2017 Language Specification, ECMA 262, Eighth Edition. 2017.