Ruby on Rails Sunday, August 30, 2015

No they just use existing tables, do some joins and generate the item recommendations. Their interface looks like: recommendations(user_id) and returns [item_id]

On Sunday, August 30, 2015 at 1:03:20 AM UTC-7, Colin Law wrote:
On 30 August 2015 at 04:36, venu madhav chitta
<venu.ch...@gmail.com> wrote:
> I am implementing strategy pattern in Rails where I have Models like User,
> Item, Category and need to recommend items for the users depending on
> various algorithms (strategies) that user selects in view.
>
> I am having a Recommend class which has an interface of recommend(user_id,
> strategy) and returns array of item_id. The strategy in recommend will be
> decided at runtime depending on the option user selects in the view. I have
> placed the recommend interface in /lib directory and the strategies in
> /lib/strategy directory. The strategies or algorithms right now will do SQL
> queries to give recommendations which is naive.
>
> I want to make sure if I placed the files in proper directories or Should I
> need place the recommend class and all the strategies in models or
> app/services or any other?. I am really confused.

Are there database tables behind the recommend and strategy code or
are they just code?
You say there are Items but have not told us what an Item is.

Colin

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/c9c746c9-2957-49a3-a9ba-f52aa7ae61ec%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment