Mailinglist Archive: opensuse-buildservice (176 mails)

< Previous Next >
[opensuse-buildservice] Proposal to use service objects in models
Hi all, I'd like to start using service objects as a way of reducing the number of lines in the model
classes. Please see this PR as an example:

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

At the moment the way the models are organized seems to be done with the thinking that
"if the code is related to the Repository class then put it in the Repository class" but I think it
would be helpful to start organizing our code in a more structured way because many of the classes are
just too big and hard to follow IMO. Here is a good article about ways in which this can be done.
Some of these patterns we already have in the app i.e. decorators and policy objects.

http://blog.codeclimate.com/blog/2012/10/17/7-ways-to-decompose-fat-activerecord-models/

Of course I'm open to alternative ideas or maybe you don't think that this is necessary at all
and its fine the way it is? Let me know what you think.

Thanks, 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 >