Bugs in Commonly-Used Classes Have Wide Effects
Explore the impact of bugs in commonly used classes in Ruby on Rails applications. Understand concepts like fan-in and fan-out, and how issues in central classes can disrupt large parts of your app. Learn to manage complexity and maintain stable, sustainable code by focusing on critical classes with wide dependencies.
We'll cover the following...
Let’s talk about the interdependence of pieces of code. Some methods are called in only one place in the application, while others are called in multiple places.
How does the controller method work?
Consider a controller method. In most Rails apps, there is only one way a controller method gets called: when an HTTP request is issued to a specific resource with a specific method. For example, we might issue an HTTP GET to the URL /widgets. That will invoke the index method of the WidgetsController.
How does the find method work?
Now, consider the find method on User. This method gets called in many more places. In applications that have authentication, it’s possible ...