Jump to content

Creating an MVC site


Recommended Posts

I have created an MVC site before as part of my degree and didn't like it, but now I see its actually quite a powerful concept.  Despite this, I'm not actually sure how to proceed.  So far in my design I have the following classes:

 

- DBGateway:  Connects to the MySQL database, this is the only class with SQL specific functions.  Its functions receive the SQL query syntax and then generates exceptions or returns the data (in the form of an instance of DBResult).

- DBResult:  This is a special object that houses the results in various arrays etc from the database (through DBGateway).

- user:  Holds all information regarding user, including output of HTML when appropriate function called.

- product:  Holds all information regarding product, including output of HTML when appropriate function called.

 

Additional classes include shoppingItem and shoppingCart, although these won't be implemented yet.  I recall in my degree project I had some form of controller class.  I'm not quite sure how to use this though.  Any ideas what a controller class could be for?

Link to comment
Share on other sites

If you're interested in leveraging MVC, I'd suggest taking a look at CodeIgniter. It's a pretty well documented implementation. I'd demo it and see how you like it... worst case scenario you should get some ideas for how you might implement your own.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.