DEV Community

Discussion on: Where to start refactoring.

Collapse
 
thecodetrane profile image
Michael Cain

In my experience, it helps to work outside-in. Is there a way to scope the refracturing you want to do into pieces that break down into individual tasks? Doing so will help keep you organized, and perhaps break the refectory down into sprint-able chunks that can be done/deployed alone.

Collapse
 
drbragg profile image
Drew Bragg

For the rails side I'm trying to stick with each part as M and C. One of my main goals is to extract some of the more presentational code from the models into helpers and skinny up the controllers.

Collapse
 
thecodetrane profile image
Michael Cain

Word. That could be an epic in itself, yeah? “Abstract presentational code to helpers” and have stories for each model/model type. That way, if you work in chunks you can CI your changes.

Thread Thread
 
drbragg profile image
Drew Bragg

Since rails is serving as only an api in this instance I figured I could use decorators pretty heavily in the json responses and really DRY up both the jbuilder files and my models.