Confuse With Model And Component

Hi All,

I was confuse now, in what condition we have to use model retrieve database data and when using Component and write AR script to retrieve database data. Is that was same? Or which method is better?

Personally I use components just when I create a portlet, like recentComments in the Blog demo. Not sure if it’s the best approach but it’s what I do.

its up to you what you prefer AR provides simple api to work with records but there is small performance penalty you pay but its worth it.

Is that mean AR query can be write in component or models too? base on the user? I would like to know which way was the good practice, i have look at some people project, some write to model and some in component so i was confuse.