Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Effective Angular

You're reading from   Effective Angular Develop applications of any size by effectively using Angular with Nx, RxJS, NgRx, and Cypress

Arrow left icon
Product type Paperback
Published in Aug 2024
Publisher Packt
ISBN-13 9781805125532
Length 400 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
Roberto Heckers Roberto Heckers
Author Profile Icon Roberto Heckers
Roberto Heckers
Arrow right icon
View More author details
Toc

Table of Contents (18) Chapters Close

Preface 1. Part 1:Angular Basics and Setting Up Scalable Nx Workspaces
2. Chapter 1: Scalable Front-End Architecture for Angular Applications FREE CHAPTER 3. Chapter 2: Powerful Angular Features 4. Chapter 3: Enhancing Your Applications with Directives, Pipes, and Animations 5. Chapter 4: Building Forms Like a Pro 6. Part 2:Handling Application State and Writing Cleaner, More Scalable Code
7. Chapter 5: Creating Dynamic Angular Components 8. Chapter 6: Applying Code Conventions and Design Patterns in Angular 9. Chapter 7: Mastering Reactive Programming in Angular 10. Chapter 8: Handling Application State with Grace 11. Part 3:Getting Ready for Production with Automated Tests, Performance, Security, and Accessibility
12. Chapter 9: Enhancing the Performance and Security of Angular Applications 13. Chapter 10: Internationalization, Localization, and Accessibility of Angular Applications 14. Chapter 11: Testing Angular Applications 15. Chapter 12: Deploying Angular Applications 16. Index 17. Other Books You May Enjoy

Understanding scalable front-end applications

Modern web applications are constantly getting bigger and more complex. Because of this, developing scalable front-end applications is more critical than ever. To create scalable front-end applications, we need to understand what scalability means in the context of a front-end application.

What is scalability?

The first thing that might come to mind when you hear the term scalability is handling more traffic. However, in the context of front-end applications, when talking about scalability, we mostly mean the scalability of the code base. Or, more concisely, the code is easy to extend, and modules or micro front-ends can be added to the software without much work. Components and libraries are reusable; the code is easy to maintain, test, and debug, even when the application grows. You can work with different teams on separate parts of the application, and onboarding new teams that write similar code is easy to achieve and enforce. The application has good performance and small bundle sizes. Compile and build times remain low, and deployment can be done swiftly to different staging environments if needed.

To achieve these feats within your front-end applications, you must create a good architecture, a set of tools, and rules everyone can adhere to. Your architecture will include elements such as your repository type, folder structure, architectural patterns, design patterns, a programming language, framework, and tools for building, testing, linting, and deploying your application. Making the right decisions for each part of your architecture helps with creating scalable applications that are easy to maintain and extend.

When making architectural decisions, you should aim to create a fast, loosely coupled, testable system. You want to avoid direct dependencies between different parts of your system so that you don’t get stuck and need to refactor the entire application when the business introduces changes.

With this brief introduction to what a scalable front-end application is, let’s understand the importance of a good front-end architecture.

Why is front-end architecture important?

Good architecture is essential to maintain a good workflow for the developers working on the software and makes it easy for new teams and team members to join. If developers spend much time refactoring or waiting for builds or tests to complete, they wander off and do less productive things.

With good architecture in place, the code base remains manageable, even when your applications grow. Without good architecture, the code becomes messy and hard to debug or extend. As time progresses, such problems will pile up, and developers will be wasting more time on bugs and refactoring than creating new features, especially in large enterprise solutions where business needs are constantly changing. Before you know it, you will have a web of dependencies, and adding simple things will become very time-consuming.

Suppose you’re building an application for employee scheduling that includes a calendar component. You want to avoid tight coupling between the calendar and scheduling applications. When management lets you know the company is adding another application – let’s say a project management tool that also includes a calendar – you don’t want to redo the entire calendar component and scheduling application because the two are tightly coupled.

The following figure shows the development process with and without architecture. Without architecture, you start fast, but in the end, you are crawling. With architecture, you will have a consistent and predictable work pace:

Figure 1.1: Development speed

Figure 1.1: Development speed

Now that you understand what we mean by scalable front-end applications and why having good architecture is essential to achieve them, we will dive into some approaches to scaling front-end applications and learn about their advantages and trade-offs.

You have been reading a chapter from
Effective Angular
Published in: Aug 2024
Publisher: Packt
ISBN-13: 9781805125532
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image