• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Implementation Details

#1
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.
 

Kier

XenForo Developer
Staff member
#5
  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.
  1. There are some places where it does, but performance has been carefully tweaked.
  2. No.
  3. Yes.
 
#6
Thanks.

1. Could you elaborate on "some places"? In particular, is it used on ".../threads/...12345/page-1234" and ".../forums/...123/page-12"?
 

Jaxel

Well-known member
#8
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.
 

Shadab

Well-known member
#9
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.)
 

Carlos

Well-known member
#10
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.
 

Jethro

Well-known member
#11
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.
 

feldon30

Well-known member
#14
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.