Solved

MVC vs basic pages

Posted on 2014-04-28
5
200 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 74

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 74

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 74

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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

There is a huge demand for CodeIgniter among the PHP web developers due to its dynamic features and benefits these days. It is one of most popular and agile open source PHP framework for creating robust web applications in PHP web development field.…
Introduction Since I wrote the original article about Handling Date and Time in PHP and MySQL (http://www.experts-exchange.com/articles/201/Handling-Date-and-Time-in-PHP-and-MySQL.html) several years ago, it seemed like now was a good time to updat…
This tutorial walks through the best practices in adding a local business to Google Maps including how to properly search for duplicates, marker placement, and inputing business details. Login to your Google Account, then search for "Google Mapmaker…
The viewer will learn how to dynamically set the form action using jQuery.

706 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now