Data Architecture in Angular 2

An Overview of Data Architecture

Managing data can be one of the trickiest aspects of writing a maintainable app. There are tons of ways to get data into your application:

The problem of data architecture addresses questions like:

For many years MVC was a standard pattern for architecting data in applications: the Models contained the domain logic, the View displayed the data, and the Controller tied it all together. The problem is, we’ve learned that MVC doesn’t translate directly into client-side web applications very well.

There has been a renaissance in the area of data architectures and many new ideas are being explored. For instance:

There are a lot of variations on these ideas. For instance:

  • Flux is a pattern, and not an implementation. There are many different implementations of Flux (just like there are many implementations of MVC)
  • Immutability is a common variant on all of the above data architectures.
  • Falcor is a powerful framework that helps bind your client-side models to the server-side data. Falcor often used with an Observables-type data architecture.

Data Architecture in Angular 2

Angular 2 is extremely flexible in what it allows for data architecture. A data strategy that works for one project doesn’t necessarily work for another. So Angular doesn’t prescribe a particular stack, but instead tries to make it easy to use whatever architecture we choose (while still retaining fast performance).

The benefit of this is that you have flexibility to fit Angular into almost any situation. The downside is that you have to make your own decisions about what’s right for your project.

Don’t worry, we’re not going to leave you to make this decision on your own! In the chapters that follow, we’re going to cover how to build applications using some of these patterns.

 
This page is a preview of ng-book 2.
Get the rest of this chapter plus hundreds of pages Angular 2 instruction, 5 sample projects, a screencast, and more.

 

Ready to master Angular 2?

  • What if you could master the entire framework – with solid foundations – in less time without beating your head against a wall? Imagine how quickly you could work if you knew the best practices and the best tools?
  • Stop wasting your time searching and have everything you need to be productive in one, well-organized place, with complete examples to get your project up without needing to resort to endless hours of research.
  • You will learn what you need to know to work professionally with ng-book 2: The Complete Book on Angular 2 or get your money back.
Download the First Chapter (for free)