Make every little piece a model

I’m considering making every little piece of editable content on my site
a model with it’s own table.

So if you think of a blog post for example, the title, subject, body,
whatever…would be a separate table. With the proper associations of
course.

The reason for this is to 1.) allow for special attributes to be
assigned to each piece of content, 2.) to allow for each piece of
content to be edited individually via ajax.

You can think of it as making everything into a component/widget.

My questions are:
1.) How much extra strain would this be on the database. So now instead
of just fetching one row with the data, you would query each table
association for the right info.

2.) Does anyone have any good examples/tutorials for turning every piece
of content on your site into an ajax editable component?

On Apr 27, 4:09pm, masta Blasta [email protected] wrote:

You can think of it as making everything into a component/widget.

Without a better reason, I would advise against “making everything a
model”. For small applications, I doubt you would see a noticeable
difference in speed of the db.

masta Blasta wrote in post #1058719:

I’m considering making every little piece of editable content on my site
a model with it’s own table.

Call it considered, then go build something sensible.

So if you think of a blog post for example, the title, subject, body,
whatever…would be a separate table. With the proper associations of
course.

I think of a blog post (object) as having a title, subject, body,
whatever (attributes).

The reason for this is to 1.) allow for special attributes to be
assigned to each piece of content, 2.) to allow for each piece of
content to be edited individually via ajax.

I’m sure there are other, simpler, ways to deal with these scenarios.

You can think of it as making everything into a component/widget.

Not even systems based entirely on components/widgets carry this idea
all the way down to the model layer. Components/widgets are
view/controller layer concerns.

My questions are:
1.) How much extra strain would this be on the database. So now instead
of just fetching one row with the data, you would query each table
association for the right info.

I would not expect many to consider this to be a “scalable” design.

2.) Does anyone have any good examples/tutorials for turning every piece
of content on your site into an ajax editable component?

I’m not aware of any. But, there has to be a better way than what you
suggest. AJAX should not in any way dictate how the model layer persists
its data. It’s the job of the controller and view to collect and arrange
the data for use by the model.