benobo

Topic: About JobberBase's PHP design pattern : MVC ?

I've got some questions about the design pattern in use with JB. I think it is Model View Controller... I hear about MVC a lot, and I'm curious about JobberBase's app architecture... Because I think it is very nicely coded! Well, as long as code can be nice tongue

Are :
_includes/ the models ?
_templates/ the views ?
and the page_something.php are the controllers ? Same thing with the admin panel, I assume.

Thanks in advance :-)

Chronos

Re: About JobberBase's PHP design pattern : MVC ?

MVC seems to be the structure used in JobberBase, although some less-clean coded files overlap a bit;

_templates/ -> Smarty-Based HTML templates (views)
_includes/ -> Does all the queries and calculating, can be accessed by the page_section.php files
page_section.php -> Processing and assigning information (given by classes) to the templates

Member of Jobberbase Development Team - Implementation and Coding

Visit my Blog: ChronoScripts (JobberBase scripts, support and freelance)
JobBoards: Telefonisch Werk and Top Bijbaan

benobo

Re: About JobberBase's PHP design pattern : MVC ?

Okay, as soon as I am trying to learn OOP with php, I was wondering if taking JobberBase as a design-pattern model would be a good thing. I guess it is :-)

Last edited by benobo (2009-01-23 18:12:12)

filipcte

Re: About JobberBase's PHP design pattern : MVC ?

It's more like "separation of business logic from view logic" than MVC, actually.

@Chronos is right:
* index.php - main router (gets requests, processes them and forwards them to the right business-logic);
* _templates - represents view logic;
* page_* + _includes - business logic. A bit more messy than it could be, but good enough. Ideally, all SQL should be in _includes, inside specific classes and functions.

Original jobberBase author
www.filipcte.com

benobo

Re: About JobberBase's PHP design pattern : MVC ?

Thanks Filip.

Step by step I get a better view of the MVC design pattern. I really like the way JB is coded : it's very easy to understand even for a noob like me :-)

I've read somewhere that you'd like to implement a plugin system into future versions of JobberBase. This would be very sweet and also making everyone love JB even more...

On the technical side, I guess this could be achieved using the Snoopy class, like it currently is in Wordpress? I think this almost-CMS has one of the greatest plugin system ever made on a php system, so it should be a good inpiration source for JobberBase plugins...

BornForCode

Re: About JobberBase's PHP design pattern : MVC ?

Filip can you make the get parameters more generic? So the dispetcher will simply put them at any controller use? Currently the parameter mapping is quite static, for example first parameter must be an id which makes somehow the architecture rigid.

Contact me if you want to offer me paid development jobs in PHP, ASP etc smile

nightm

Re: About JobberBase's PHP design pattern : MVC ?

Hi Filip! You did a very nice job with jobber:). Nice framework you made here too.

I am very curious of something, at your job at Lateral, you work with the same framework or you use something more advanced, house-made or an open source choice?

Why did you say that jobberbase "It's more like 'separation of business logic from view logic' than MVC" ? It's not all PHP5 OOP, but i think that it's a good, simple approach of MVC.

Cheers!

Last edited by nightm (2010-02-11 19:36:57)

filipcte

Re: About JobberBase's PHP design pattern : MVC ?

Thanks, @nightm smile!

On our projects, we use a variety of frameworks: 1) a more advanced version of the one in jobberBase (which is 2+ years old... very old in Internet-years); 2) another in-house-made framework, quite different from the first; 3) Zend Framework. And, like many others, a lot of WordPress and Drupal smile.

It's not pure MVC, that's why I said that. MVC has a strict approach, and jobberBase is very... loose smile.

Well, good luck in what you're doing!

Original jobberBase author
www.filipcte.com