Line 553:
Line 553:
[[Category:Development]]
[[Category:Development]]
−
== Design pattern for Graphic interfaces ==
+
== Design pattern for Graphic interfaces (MVC) ==
There are several design patterns for user interfaces (MVC, MVP, MVVM).
There are several design patterns for user interfaces (MVC, MVP, MVVM).
Many confuse this design pattern with that of using a template framework. It's unrelated. A template framework (see previous point) is only linked to the "V" part of these models.
Many confuse this design pattern with that of using a template framework. It's unrelated. A template framework (see previous point) is only linked to the "V" part of these models.
-> Dolibarr uses the '''MVC''' Design Pattern. Part M is materialized by a DAO class containing the CRUD (Create-Read-Update-Delete) methods for accessing the table.
-> Dolibarr uses the '''MVC''' Design Pattern. Part M is materialized by a DAO class containing the CRUD (Create-Read-Update-Delete) methods for accessing the table.
−
Many frameworks have chosen to put the C code part (Controller) and the V code part (view) in files, or even separate directories. The maintenance seems easier on paper, in practice, you have to juggle constantly between n files, the C being strongly linked to the V. Also in Dolibarr, the separation is made by a simple comment section. The part of code C (Controller) is therefore the code that is the tag
+
Many frameworks have chosen to put the C code part (Controller) and the V code part (View) in different files, or even separate directories. The maintenance seems easier on paper, in practice, you have to juggle constantly between a ton of files when your project become larger. In Dolibarr, the separation is made by a simple comment section. The part of code C (Controller) is therefore the code that follow the tag
<pre>
<pre>
/ *
/ *