Changes for page Best Practices

Last modified by Vincent Massol on 2017/09/05

<
From version < 6.1 >
edited by Vincent Massol
on 2012/11/17
To version < 5.2 >
edited by Eduard Moraru
on 2012/05/24
>
Change comment: There is no comment for this version

Summary

Details

Page properties
Author
... ... @@ -1,1 +1,1 @@
1 -XWiki.VincentMassol
1 +XWiki.enygma
Content
... ... @@ -1,13 +1,5 @@
1 1  {{toc/}}
2 -= Where to put code? =
3 3  
4 -Since xwiki allows to put code both in wiki pages and in Java you might wonder where you should put your code. Here's some general guidelines:
5 -* Don't put "business logic" code in wiki pages. Use Java for that. This gives you nice IDEs, the ability to easily debug the code and the ability to write automated unit tests. Generally speaking it makes it easy on maintenance.
6 -* In general put the minimum amount of scripts in your wiki pages since that makes it harder to maintain.
7 -* The only scripts that you may put in wiki pages are "presentation logic" code.
8 -
9 -Said differently you should use the [[MVC>>http://en.wikipedia.org/wiki/Model%E2%80%93view%E2%80%93controller]] approach by separating your Model (what we called "business logic" above) from your View (what we called "presentation logic" above).
10 -
11 11  = XWiki Application Organization =
12 12  
13 13  This [[Best Practices document>>Best Practices XWiki Application Organization]] explains how to best organize an XWiki Application.

Get Connected