Giter Club home page Giter Club logo

Comments (2)

fpcyan avatar fpcyan commented on May 22, 2024

Okay, so I began refactoring the application html and application controller, but I ran into some trouble in that the "fetch commits" method is used for multiple different things. This led me down the rabbit hole, and now I'm drawing up model-level assocations that are missing.
I think the easiest way to refactor the codebase would be the following:

  • add ActiveRecord associations between models
  • move logic for rendering from views to their controllers, where possible
  • fetch data needed for the views through for the controllers through associations
  • condense views logic where needed

The benefit of this is that it will actually reduce the complexity of the codebase, and allow for new featured to be plugged in easier. Also, if you want to change a feature, it will require you to update code in far fewer places (for example, if you wanted to change how you fetch from fetch_taxonomies, you might have to change logic in 9 files right now).

Also the nice thing about this is that it won't break anything to do any single step. If somebody refactors the db and model associations, it shouldn't affect the controller or views. That way all changes are incremental, and it's not one huge project to do it all. :)

Edit: Anyway, the way I got here is that "fetch_taxonomies" is actually just a replacement for things that ActiveRecord associations do.

from ifme.

fpcyan avatar fpcyan commented on May 22, 2024

I drew a picture. It's a little overwhelming at first so I tried to break it up using whitespace. Are other users capable of commenting on anything besides strategies? I couldn't find anywhere else on the site.
untitled 1

from ifme.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.