# Design Question: Where should I put this?

**URL:** <https://www.ruby-forum.com/t/design-question-where-should-i-put-this/73777>\
**Category:** Rails\
**Created:** [October 26, 2006, 11:30pm UTC](https://www.ruby-forum.com/t/design-question-where-should-i-put-this/73777 "2006-10-26T23:30:56Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![damaris](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/2bfe46/32.png) [@damaris](https://www.ruby-forum.com/u/damaris)\
**Post date:** [October 26, 2006, 11:30pm UTC](https://www.ruby-forum.com/t/design-question-where-should-i-put-this/73777/1 "2006-10-26T23:30:56Z")

</div>

Hi you all,  
I’m starting an application with some internal functionalities such as  
“converters” and “analyzers”. Basically, my app is a wiki, but  
semantically enhanced (I’ve already said that in this forum :D). The  
semantic annotations are kind of “parsed” with converters and analysers  
of my own, but I don’t really know where do I have to set these conv.  
and analy. on my architectural design. Should they be at the model  
layer? Or are they kind of controllers?

(BTW, I don’t wanna put this stuff in the lib/ directory. Or even though  
I did that, I would like to “draw” them somewhere in my pretty  
architectural design diagram :D)

Thanks.

---

<div class="post-metadata">

**Author:** ![damaris](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/2bfe46/32.png) [@damaris](https://www.ruby-forum.com/u/damaris)\
**Post date:** [October 27, 2006, 1:15am UTC](https://www.ruby-forum.com/t/design-question-where-should-i-put-this/73777/2 "2006-10-27T01:15:09Z")

</div>

Damaris F. wrote:

> Hi you all,  
> I’m starting an application with some internal functionalities such as  
> “converters” and “analyzers”. Basically, my app is a wiki, but  
> semantically enhanced (I’ve already said that in this forum :D). The  
> semantic annotations are kind of “parsed” with converters and analysers  
> of my own, but I don’t really know where do I have to set these conv.  
> and analy. on my architectural design. Should they be at the model  
> layer? Or are they kind of controllers?
> 
> (BTW, I don’t wanna put this stuff in the lib/ directory. Or even though  
> I did that, I would like to “draw” them somewhere in my pretty  
> architectural design diagram :D)
> 
> Thanks.

Models represent data. They might be global helpers if they are only  
used in the view.

But most likely, they are libraries or plugins.

---

<div class="post-metadata">

**Author:** ![damaris](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/2bfe46/32.png) [@damaris](https://www.ruby-forum.com/u/damaris)\
**Post date:** [October 27, 2006, 1:23am UTC](https://www.ruby-forum.com/t/design-question-where-should-i-put-this/73777/3 "2006-10-27T01:23:24Z")

</div>

Alex W. wrote:

> Damaris F. wrote:
> 
> > Hi you all,  
> > I’m starting an application with some internal functionalities such as  
> > “converters” and “analyzers”. Basically, my app is a wiki, but  
> > semantically enhanced (I’ve already said that in this forum :D). The  
> > semantic annotations are kind of “parsed” with converters and analysers  
> > of my own, but I don’t really know where do I have to set these conv.  
> > and analy. on my architectural design. Should they be at the model  
> > layer? Or are they kind of controllers?
> > 
> > (BTW, I don’t wanna put this stuff in the lib/ directory. Or even though  
> > I did that, I would like to “draw” them somewhere in my pretty  
> > architectural design diagram :D)
> > 
> > Thanks.
> 
> Models represent data. They might be global helpers if they are only  
> used in the view.
> 
> But most likely, they are libraries or plugins.

um…but I thought in MVC, model layer represented the persistent data  
AND the business logic…

Anyway, you are right about the helpers, cause I will use data stored in  
models, and I will render them somehow.  
Buut… I also have the other way round; I have some annotations in the  
view (plain text), and I want to transform these ann. into RDF  
statements, and then stored them in the repository (the model). Where  
should I put this transformer? Cause even though I put this transformer  
as a plugin or lib, where do I do the transformation? At the controller,  
don’t I?

Lots of thanks.

---

<div class="post-metadata">

**Author:** ![damaris](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/2bfe46/32.png) [@damaris](https://www.ruby-forum.com/u/damaris)\
**Post date:** [October 27, 2006, 12:05pm UTC](https://www.ruby-forum.com/t/design-question-where-should-i-put-this/73777/4 "2006-10-27T12:05:20Z")

</div>

Alex W. wrote:

> Models represent data.

Lets not devalue the model. Its more than just data (and persistance,  
in the case of the ActiveRecord pattern). Its most importantly about  
behaviour, and about modelling your core domain in the software. It is  
your app’s business logic - the “meat” of your app, as it were.

---

<div class="post-metadata">

**Author:** ![damaris](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/2bfe46/32.png) [@damaris](https://www.ruby-forum.com/u/damaris)\
**Post date:** [October 28, 2006, 7:42pm UTC](https://www.ruby-forum.com/t/design-question-where-should-i-put-this/73777/5 "2006-10-28T19:42:18Z")

</div>

unknown wrote:

> Alex W. wrote:
> 
> > Models represent data.
> 
> Lets not devalue the model. Its more than just data (and persistance,  
> in the case of the ActiveRecord pattern). Its most importantly about  
> behaviour, and about modelling your core domain in the software. It is  
> your app’s business logic - the “meat” of your app, as it were.

Ummmm… so, perhaps it wouldn’t be so baaaaad letting and analyzer as  
part of the model, cause the analyzer takes an input of the user and  
transform it to store it persistently…

---

<div class="post-metadata">

**Author:** ![damaris](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/2bfe46/32.png) [@damaris](https://www.ruby-forum.com/u/damaris)\
**Post date:** [October 29, 2006, 10:13pm UTC](https://www.ruby-forum.com/t/design-question-where-should-i-put-this/73777/6 "2006-10-29T22:13:57Z")

</div>

I always visualized the model as one of those shape-pegboards that only  
let square pegs in the square hole, and so on. (like this:  
[http://www.educationallearninggames.com/images/shapes-chucky-puzzle.jpg](http://www.educationallearninggames.com/images/shapes-chucky-puzzle.jpg))

So the model / pegboard sits between the controller (and the world) and  
your database. It is the model’s job to do whatever transformations are  
necessary to enable the data to fit through the hole. (business logic,  
sanitizing, etc)

---

<div class="post-metadata">

**Author:** ![damaris](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/2bfe46/32.png) [@damaris](https://www.ruby-forum.com/u/damaris)\
**Post date:** [October 29, 2006, 11:01pm UTC](https://www.ruby-forum.com/t/design-question-where-should-i-put-this/73777/7 "2006-10-29T23:01:33Z")

</div>

Oook, thank you all! 😃

---

<div class="post-metadata">

**Author:** ![damaris](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/2bfe46/32.png) [@damaris](https://www.ruby-forum.com/u/damaris)\
**Post date:** [October 29, 2006, 9:17pm UTC](https://www.ruby-forum.com/t/design-question-where-should-i-put-this/73777/8 "2006-10-29T21:17:46Z")

</div>

It sounds like part of your model to me.
