Quantcast
Channel: JavaScriptMVC Forum
Viewing all articles
Browse latest Browse all 3491

model best practice?

$
0
0
I've just started working at a new job. While reviewing the code I've found that their models make service calls using other models. This seems like a strange way to construct a model. But I'm not an expert.  Can anyone tell me if this is a reasonable architecture?

Example:
The init() or another functions on a model besides it's own CRUD functions, makes findOne() and findAll() calls on other models. The results from the secondary model calls are added to the base model or used in conditional statements to modify the original model properties.

largo

Viewing all articles
Browse latest Browse all 3491

Trending Articles