Welcome Guest, Not a member yet? Register   Sign In
MVC vs OOP in general?
#21

[eluser]wiredesignz[/eluser]
While you and your buddy Sturgeon continue to offer incorrect information into the forums I will keep reminding you of the "correct" use of the MVC design pattern.

If you don't feel it's important to teach the proper concepts of MVC then you should leave it to those that do.

EDIT:
Models do not provide an abstraction layer. ActiveRecord and ORM and other data access components provide the abstraction layer. Models are meant to encapsulate the abstraction layer and contain the business logic for your application.

This is the point you never seem to understand.
#22

[eluser]Joey Dendron[/eluser]
Hello again

Thanks Phil for your replies - sorry this seems to be generating a bit of heat... I posted my last reply perhaps just before Phil posted his first reply, which is why I didn't reference his points. In any case, I've obviously got plenty of reading to do around ORM, and thinking about the extension of models.

FWIW, I've definitely got very good value out of this thread, so if anyone wants to step away from any controversy, don't worry that you'll be harming my education Wink

Have a good day guys, many thanks once again!
JD
#23

[eluser]wiredesignz[/eluser]
No need to apologise, there is no controversy, everyone including Phil might learn something from this discussion too.
#24

[eluser]n0xie[/eluser]
See this rather well put explanation:
Quote:The model is not a database: the 'model' in MVC is both the data and the business/domain logic needed to manipulate the data in the application. 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. Models are not data access objects; however, in very simple apps that have little domain logic there is no real distinction to be made. Active Record is an accepted design pattern which merges domain logic and data access code - a model which knows how to persist itself. http://en.wikipedia.org/wiki/Model–View–Controller
#25

[eluser]pbreit[/eluser]
Wired, if you are trying to teach, you are not doing a very good job. At all.
#26

[eluser]wiredesignz[/eluser]
@pbreit, Maybe the topic is too advanced. Is there something you need to know specifically?
#27

[eluser]Keyur Shah[/eluser]
wiredesignz, i'm interested in seeing more about mvc as you describe it. can you provide the names of some software apps that you feel have been developed well. i want to download and look through code to see how i can similarly implement it in my own app (i'm currently working on a shopping cart / checkout system).

like the original poster i'm also intrigued in how to better apply oop principles while building out an application. i'm coming from a procedural background and sometimes it feels as i'm just putting my code in separate places without taking better advantage of the possibilities.

thanks.
#28

[eluser]stuffradio[/eluser]
[quote author="wiredesignz" date="1291299656"]I cannot stress how wrong it is to consider a model as a representation of a single database table.

A model is a representation of the real world. It can represent one or many tables, it may represent XML files, or any other external data source(s) that you might need.

http://www.phpwact.org/pattern/model_view_controller

Other design patterns are fairly advanced but can be used comfortably within CI.

There is no shame in writing simple applications to begin with.[/quote]

Sometimes I do Models for single tables, and sometimes depending on what it is I use a model and group different functions for it.

For example, maybe a User model will have things to do with adding, deleting, editing users... and maybe sending a message to the user or just other things that have to do with users.




Theme © iAndrew 2016 - Forum software by © MyBB