Solved

MVC vs basic pages

Posted on 2014-04-28
5
205 Views
Last Modified: 2014-09-02
We're a small business where our clients have specific business goals to meet and most of the time have specific business reporting. Many of our backend business tools (SCRUD) are built in either msaccess or basic php pages. To explain 'basic php pages', for instance we have a search page that allows management to search customer orders and view details of those orders and cancel or add notes to the orders. The code written for the search page is written basic top down style with database code mingled in with presentation code.

We have recently hired a developer to help us with rewriting our backend process's using MVC style of coding. We're comfortable rewriting our code in top down style with the mingled database/presentation logic. Looking at the code written by the developer in MVC style seems like overkill for what we want to get done and we're trying to figure out the benefits to adjusting our coding habits to think of coding in this MVC style. The developer uses MVC style along with many other 3rd party add on's (slim/paris/idiorm/smarty)

Today I have a simple report to display which would return values from a single db table with only date parameters. I'm looking at the daunting task of learning this developers style along with these 3rd party addons along with MVC style of coding. Its just a little overwhelming and I'm having second thoughts on whether MVC along with all these addons are worth learning to support the rewriting of our backend business tools.

I'm looking for help deciding whether MVC and these addons are worth our time:

What are the advantages of any one style over another, assuming MVC is the most popular are there other alternatives? Data security is our top priority since we're moving our backend tools from an intranet to the internet.
0
Comment
Question by:Dalexan
  • 3
  • 2
5 Comments
 
LVL 75

Expert Comment

by:käµfm³d 👽
ID: 40027280
MVC gives your code a clear separation of concerns. You've already stated that you have "database code mingled in with presentation code." This is a fragile design. Now if you have to move to a different presentation framework or if you move to a different database backend, your presentation logic has to change. With a clear separation (doesn't even have to be MVC) you avoid such dependencies.

So, do you have to learn MVC? No. MVC is just the "hottest thing out" right now. That said, it is a solid architectural style, and can be translated into any programming language. It can even be used in non-web projects. Admittedly, there is a learning curve. You would not be doing yourself a disservice by learning the style, though.

MVC can help with security in that your separate out the concerns between the layers. However, it's primary goal isn't security. For security you need to be mindful of how you write your queries, how you validate your user inputs, and how you authenticate/authorize your users.

The only other styles I know of on the web is MVP (model-view-presenter) and MVVM (model-view-view_model), neither of which is as prevalent as MVC. The latter is really more of a WPF/Silverlight architectural style. MVP is close to MVC in structure. If I recall correctly, the only real difference is which layers communicate with each other. I'm sure there are other styles, though.
0
 

Author Comment

by:Dalexan
ID: 40027336
Thanks, pretty good description.
What about the 3rd party stuff, SLIM in particular?
0
 
LVL 75

Accepted Solution

by:
käµfm³d   👽 earned 500 total points
ID: 40027381
I have to defer on those. PHP is not my main language, so I am unfamiliar with the 3rd-party tools available for it.
0
 

Author Comment

by:Dalexan
ID: 40027474
Thanks Kaufmed, you've won most of the points but I would still like to hear more comments regarding the 3rd party stuff. SLIM,idiorm etc...
0
 
LVL 75

Expert Comment

by:käµfm³d 👽
ID: 40298567
I should correct myself on an earlier statement. MVVM is actually growing in popularity. Many of the Javascript frameworks out now are leaning towards MVVM.
0

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Remove lines by logo 2 31
Wrapper for APPs 9 76
Divi Them Help with Full Width header 20 68
ebay api to see some data about my customers 2 31
Although it can be difficult to imagine, someday your child will have a career of his or her own. He or she will likely start a family, buy a home and start having their own children. So, while being a kid is still extremely important, it’s also …
Any business that wants to seriously grow needs to keep the needs and desires of an international audience of their websites in mind. Making a website friendly to international users isn’t prohibitively expensive and can provide an incredible return…
This video teaches users how to migrate an existing Wordpress website to a new domain.
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…

823 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question