Content management from scratch

Not for 'how-to' coding questions but PHP theory instead, this forum is here for those of us who wish to learn about design aspects of programming with PHP.

Moderator: General Moderators

nickvd
DevNet Resident
Posts: 1027
Joined: Thu Mar 10, 2005 5:27 pm
Location: Southern Ontario
Contact:

Post by nickvd »

mmm spam
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Post by Christopher »

david2007 wrote:MVC is unproductive and unprofitable for the customer who's paying for it.
Wow ... that' pretty impressive. So for all customers and all solutions? And given that there is no one specific MVC implementation because it is such a general pattern? Either you are ignorant regarding MVC or you are a visionary way out ahead of today's best and brightest!
(#10850)
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

david2007 wrote:There are other people in this forum and in other who say just about the same thing:
MVC is unproductive and unprofitable for the customer who's paying for it.
I haven't seen anyone here say that... I'm not advocating that MVC is the be all end all either. It is a way that has been tested time and again that has shown that it works, and fairly well.
david2007 wrote:The only difference is that I'm the only one who says it loud and clear.

Do you know how to count?

Then just make the calculations on how much time you take developing a system with and without MVC.
Just plain arithmetics, dude!
The added work on the front end used in creating a flexible framework (MVC or not) to base sites on mostly happens one time (often outside of a client's time) if you're a good developer. Some classes need alterations, but the majority need none for each client. The same can be said for the procedural code that your trying to suggest is better. However, some time and fingers in code later which system is easier to fix, alter or diagnose? Neither, both, .. it's not possible to say entirely. But I can tell you that it's harder to screw things up in an OOP environment than it is in a procedural one. Why do I think I can safely say that? Because I've done both for many many years. The code your friends have written is attempting to be object-oriented procedurally. I'm failing to see how that's revolutionary as you seem to think it is. Maybe I'm reading your words, spoken and unspoken, wrong.

Procedural has its places in production, but in this day and age, they are slowly fading off.

My count puts us at about even, at best. Can you prove me wrong?


-- we may need an uninvolved moderator to split this thread.
User avatar
onion2k
Jedi Mod
Posts: 5263
Joined: Tue Dec 21, 2004 5:03 pm
Location: usrlab.com

Post by onion2k »

david2007 wrote:Then just make the calculations on how much time you take developing a system with and without MVC.
Just plain arithmetics, dude!
Ok. I'll make some number up based on a 'best guess'. I've been writing websites and web apps for over 10 years so I imagine the numbers aren't too far off.

Time to develop a "discardable" system that functions to spec and just gets tossed at the end of the application lifecycle: 2 months.

Time to develop an MVC controlled application environment: 6 months.
Time to tailor it to a business client: 1 month.

You're entirely right that most clients won't be willing to pay for 7 months work when they could get the same functionality in 2 months. That's a clear and obvious cost saving to them, and it's the right direction to go in if their developer is charging them for the creation of a complete MVC system.

But...

We don't charge clients for writing all the MVC code. All they're charged is the time to tailor it to their needs, plus some more to cover the original code (say 1 month). Therefore you're quoting the client the same price for either software. If you sell the software to 6 clients it's paid for. Everything over that is pure profit. Once you've written applications for 20 clients you'll have a lot more money banked with the reusable object oriented code.

Reinventing the wheel kills your bottom line. End of story.
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Post by John Cartwright »

arborint wrote:
david2007 wrote:MVC is unproductive and unprofitable for the customer who's paying for it.
Wow ... that' pretty impressive. So for all customers and all solutions? And given that there is no one specific MVC implementation because it is such a general pattern? Either you are ignorant regarding MVC or you are a visionary way out ahead of today's best and brightest!
I guess this depends if you have clients that want things shipped out as fast as possible, and not concerned with the lifecycle of code. Sure, I could spit out a a 100,000 lines of an application in a month or two that was written in procedural code but I'll be damned if they ask me to debug errors that have crept up 6 months later.

Without sounding ignorant, I think it's time you actually studied MVC a bit. Lets take for instance the Zend Framework.. I've already taken several couple hours .. well more than that because I've refactored things several times .. of my own time to develop a snap in place skeleton code to begin production. Having pre-built frameworks extremely increases the development of an application.

Within 1 min, I have the Zend framework, my application framework and a skeleton application all in place. Beginning to development of the application using OOP has already taken less time for the advancements made thus far. With your method of PrOOcedural, you basically have to reinvent the elements of a framework.. such as database escaping, output filtering, input validation, session management, authentication controllers, error handling, well this list can go on for awhile so I will just stop.

So lets see just how much time it creates to make a page in evil OOP.. using Zend Framework..

MVController

Code: Select all

class IndexController extends Northern_Controller
{
	public function IndexAction()
	{
		$this->view->paintOutput($this->model->getListing());
		$this->getResponse()->appendBody($this->view->render());			
	}
}
MViewC

Code: Select all

class IndexView extends Northern_View
{
	public function paintOutput()
	{
		$this->set('test', 'this is a test');	
	}
}
ModelVC

Code: Select all

class IndexModel extends Northern_View
{
	public function getListing($listing)
	{
		return $this->fetchAlll('SELECT * FROM `listing`');	
	}
}
and the template

Code: Select all

<?php print_r($this->listing); ?>
Now that took... uhh .. 2 minute or so. With all the beatiful stuff that is happening I'd say this is ideal.
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Post by Christopher »

The funny thing is that david2007 confuses MVC with the many types of controller architectures. MVC is about separations and dependencies. They are known to have long term benefits, similar in its benefits to N-Tier. The benefits of MVC and N-Tier are long term maintainability. I recall that not only do my clients like that, but my profit is higher by reducing rework.

No controller architectures are a different story. Their goal is usually to minimize code duplication. Especially modern Front/Action controller systems.

What david2007 has implemented is a simple controller architecture and a sort of scaffolding system. He likes it -- great. But needing to ridicule something else to support your ideas is not actually supporting your idea.
(#10850)
Post Reply