Mailinglist Archive: opensuse-buildservice (176 mails)

< Previous Next >
Re: [opensuse-buildservice] Proposal to use service objects in models
The only alternative I can think of for this particular problem is to use concerns but I don't like that idea because concerns do not address the fact that the class has too many responsibilities to begin with. They just split the class into multiple files. Can anybody think of an alternative pattern we could use here to better organise the code in the models? Or maybe somebody prefers to use concerns over service objects?


On 14/03/17 12:19, Henne Vogelsang wrote:
Hey,

On 10.03.2017 10:00, Evan Rolfe wrote:

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/

What we should decide together is not *if* we need to introduce a OO pattern to make code more manageable but *which*. I would like to avoid to have all patterns, depending on who, at times, likes which more. This I find equally confusing that stuffing everything into the model.

So which of the patterns do we prefer and why?

Henne


--
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)

< Previous Next >
Follow Ups