Implementation Details

cakepie

New member
Hi,

A couple questions:
  1. Does xenForo use "ORDER BY timestamp LIMIT ..., ..." for threads and forums?
  2. Does xenForo load all forum info and permissions on every page?
  3. Is it fully based on the MVC pattern?
Thanks.
 
I dont understand how the MVC model is any different from the way we've been programming for years. User clicks something, program calculates stuff, results are displayed. This is standard stuff.
 
Its very important because its becoming a standard. Facebook started that trend, many companies are following suit - XenForo is one of them.
The MVC design pattern was conceived in 1979.
That's way before you, me and even the world-wide-web were born. :)

I dont understand how the MVC model is any different from the way we've been programming for years. User clicks something, program calculates stuff, results are displayed. This is standard stuff.
IMO, this has mostly to do with the separation of concerns. So you don't mix the business logic (ie, the processing part) with the presentation layer. If you keep everything cleanly separated and not tightly coupled, you can represent your data using multiple views quite easily. A good example is the "mini user stats" which supports html, xml and json views. (See Kier's post). And ideally, the controller and view don't have to know how the "data" is actually stored in the model. So for example, if you are caching something in the filesystem and you want to change it to save in a database, memcache, etc. you wouldn't need to modify the view and controller parts of your application that use the cached data since they don't care how & where it gets stored.

I hope I didn't say anything wrong. (The tension & excitement is enormous.)
 
The MVC design pattern was conceived in 1979.
That's way before you, me and even the world-wide-web were born. :)
I didn't know that!

But what I meant, was MVC has been getting a lot of attention lately because Facebook started to use them. I'm pretty sure that companies only just realized what you can do with the technology, so the rise of popularity has garnered more uses for it.
 
The MVC design pattern was conceived in 1979.
That's way before you, me and even the world-wide-web were born. :)

IMO, this has mostly to do with the separation of concerns. So you don't mix the business logic (ie, the processing part) with the presentation layer. If you keep everything cleanly separated and not tightly coupled, you can represent your data using multiple views quite easily. A good example is the "mini user stats" which supports html, xml and json views. (See Kier's post). And ideally, the controller and view don't have to know how the "data" is actually stored in the model. So for example, if you are caching something in the filesystem and you want to change it to save in a database, memcache, etc. you wouldn't need to modify the view and controller parts of your application that use the cached data since they don't care how & where it gets stored.

I hope I didn't say anything wrong. (The tension & excitement is enormous.)

Wouldn't this simply be a reiteration of the three tiered approach to software design? UI, business logic, db processing.
 
I dont understand how the MVC model is any different from the way we've been programming for years. User clicks something, program calculates stuff, results are displayed.
You will once you look at the XenForo code.

There's isn't a function which takes some data, formats it, and displays it. You won't find MySQL queries mixed in with code that handles the display of information. Everything is scattered out into hundreds of functions all linked together so that if I want to change how XenForo does *anything*, I can hook in and change it.

vBulletin has what, 800 hooks? And many people say it's not enough, and often we have to do ugly hacks like add another SQL query because we couldn't just extend the existing one with 1 more column, or we have to wait until the HTML is generated, and then try to parse it and add to it. XenForo essentially has infinite hooks.

Honestly, the first time people look at XenForo and say 'ok, how do I write mods for this?' they are going to be scared. But hopefully as documentation appears, and other plugins become available, we can learn from it. Also, it's been recommended to install an IDE (Integrated Development Environment) which actually reads in all the XenForo PHP files and understands the links and relationships between the files. You can view what XenForo is doing as a branching tree, instead of trying to cross-reference a stack of flat PHP files all including and extending each other.
 
Top Bottom