Mailinglist Archive: opensuse-buildservice (63 mails)

< Previous Next >
[opensuse-buildservice] Proposal to use more namespaces to organise controllers
Hi all, I have a PR in which I've started to use namespaces to organise some new controllers and wanted to make sure everybody is onboard with this pattern since currently the only namespace we have in the controllers is Webui.

https://github.com/openSUSE/open-build-service/pull/2544

Those controllers are:

Source::KeyInfoController (https://github.com/evanrolfe/open-build-service/blob/8f016cb6b731e7d4261e4e268e7b2c84467d87cf/src/api/app/controllers/source/key_info_controller.rb)
Webui::Projects::PublicKeyController (https://github.com/evanrolfe/open-build-service/blob/8f016cb6b731e7d4261e4e268e7b2c84467d87cf/src/api/app/controllers/webui/projects/public_key_controller.rb)
Webui::Projects::SslCertificateController (https://github.com/evanrolfe/open-build-service/blob/8f016cb6b731e7d4261e4e268e7b2c84467d87cf/src/api/app/controllers/webui/projects/ssl_certificate_controller.rb)

In the case of Source::KeyInfoController this is an alternative to adding another method to SourceController which already has > 1600 lines. Namespacing will also allow us to follow a "one-controller-per-resource" (REST) pattern which would make the controller code simpler and more uniform.

Here is a pretty good article about this from our "Lord and Savior DHH™"
http://jeromedalbert.com/how-dhh-organizes-his-rails-controllers/

Please let me know what you think.

-Evan

--
Evan Rolfe
Full Stack Web Developer
SUSE Linux GmbH, Maxfeldstr. 5, D-90409 Nürnberg
Tel: +49-911-74053-0; Fax: +49-911-7417755; https://www.suse.com/
SUSE Linux GmbH, GF: Felix Imendörffer, Jane Smithard,
Graham Norton, HRB 21284 (AG Nürnberg)

--
To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@xxxxxxxxxxxx
To contact the owner, e-mail: opensuse-buildservice+owner@xxxxxxxxxxxx

< Previous Next >
Follow Ups