What is the best practical way to add a major feature/service to an existing medium-sized Ruby on Rails project?

StackOverflow https://stackoverflow.com/questions/2494039

문제

I have an existing project written in Ruby on Rails. It is sort of backend solution for the upcoming major addition to the project. What I mean is it currently serves for the admins and it already has loads of features and actual Rails files in there.

Now I am planning to add the new "Public" facing part of the App in Rails and I am wondering what could be the best solutions. I could think of the two following possible ones but I would really appreciate if anyone who had experienced this could put me in the right direction.

  • Create a new Public facing Web App using the same resources the backend Web App was using - any pros and cons?
  • Simply add the new features to the existing backend Web App - any pros and cons? (I am sure this option will make the App files grow quite large, but should I care? or not?

I have only done small Web Apps in Rails before and this is my first large one. Please, anyone, your answers will be much appreciated.

Thanks.

도움이 되었습니까?

해결책

You already have a lot of business logic in the models, so starting a new application would mean duplicating that logic, which is a maintenance nightmare.

I would simply add the public facing parts on to your existing project. I wouldn't worry about the application getting big. I've worked on a very large rails application and it works fine. (177 tables/models, 23+ controllers, etc...)

Just make sure you create a good way to separate the internal parts from the external ones, by adding a field to the User model to indicate if they are internal or external, and then as part of the authentication, limiting access to the internal parts.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top