Welcome Guest, Not a member yet? Register   Sign In
Making things DRY. Some feedback please.
#8

[eluser]drewbee[/eluser]
[quote author="nmweb" date="1218235902"]Where did that idea come from that models only do database stuff? It's nonsense. Let me quote wikipedia on MVC
Quote:Model
The domain-specific representation of the information on which the application operates. Domain logic adds meaning to raw data (e.g., calculating whether today is the user's birthday, or the totals, taxes, and shipping charges for shopping cart items).
Many applications use a persistent storage mechanism (such as a database) to store data. MVC does not specifically mention the data access layer because it is understood to be underneath or encapsulated by the Model.
The data access layer is encapsulated by the model. You ask the model for the last ten articles and it gives them back to you, how is of no importance, be it a database, text, or even randomly generate ten articles. You should be able to change the data storage of your application just by changing the models.

Granted, libraries do not have a set place in MVC, but most of them probably resemble a model. Thumbnailing, i.e. representation of an image information is imo done in the model.[/quote]

With that being said then, I would infer that retrieving the images / putting the images should be done in the model. However any manipulation to the images should be done in the controller.

Libraries are a bit weird. As I stated I tend to do all my database stuff within the library as well. Though phasing it out to a model is feasible, it seems rather pointless to me. How does everyone else handle libraries?


Messages In This Thread
Making things DRY. Some feedback please. - by El Forum - 08-08-2008, 01:00 AM
Making things DRY. Some feedback please. - by El Forum - 08-08-2008, 01:00 AM
Making things DRY. Some feedback please. - by El Forum - 08-08-2008, 02:13 AM
Making things DRY. Some feedback please. - by El Forum - 08-08-2008, 04:39 AM
Making things DRY. Some feedback please. - by El Forum - 08-08-2008, 05:00 AM
Making things DRY. Some feedback please. - by El Forum - 08-08-2008, 07:20 AM
Making things DRY. Some feedback please. - by El Forum - 08-08-2008, 11:51 AM
Making things DRY. Some feedback please. - by El Forum - 08-08-2008, 11:58 AM
Making things DRY. Some feedback please. - by El Forum - 08-08-2008, 12:08 PM
Making things DRY. Some feedback please. - by El Forum - 08-08-2008, 12:30 PM



Theme © iAndrew 2016 - Forum software by © MyBB