MantisBT - v4.0 Release (Planning)
View Issue Details
0000283v4.0 Release (Planning)Core Infrastructurepublic2009-10-04 15:022016-12-29 10:11
Assigned Tocaseydk 
PlatformOSOS Version
Product Version 
Target Version4.0Fixed in Version 
Summary0000283: Model & Controller Cleanup
DescriptionBased on feedback of a number of useful tools and smart people, I've collected some notes on how best to clean up the core modules to be cleaner, smaller, more OO-like, and more reusable in general. This will also serve to provide clean implementation for Add On Developers

I've started with the Companies module as an example.
Additional InformationThe tips include:

* Fat models, skinny controllers - the do_(module)_aed.php files serve as the Controllers for the system directing input into the Models and handling the results. At present, there is a *huge* amount of business logic in these Controllers which requires the Model to be wrapped with the same logic each and every time in order to be used safely. Moving this logic into the Models makes them more usable by other modules and code.

* Centralize Access Control to the Models instead of keeping it spread around the View, Controllers, and everywhere else willy-nilly. This will improve security in general and make the Models more usable by other modules and code.

* Use the php5 style of contructors - __construct - as opposed to the php4 style classname format.

* Use the php5 style of calling parents.
TagsNo tags attached.
Attached Files

2011-08-19 16:42   
The final two points were implemented in v2.0-v2.4
2014-06-14 18:43   
(Last edited: 2014-06-21 20:29)
The second point (access control) was wired into v3.2. These controllers are the last bit of cleanup for issue one:


Issue History
2009-10-04 15:02caseydkNew Issue
2009-10-04 15:02caseydkStatusnew => assigned
2009-10-04 15:02caseydkAssigned To => caseydk
2009-12-08 11:48caseydkProjectPending Requests => v1.3 Release (Closed)
2010-02-18 04:39caseydkProjectv1.3 Release (Closed) => v2.0 Release (Closed)
2010-05-04 20:38caseydkPriorityimmediate => high
2010-05-14 07:58caseydkSeveritymajor => minor
2010-05-30 22:52caseydkProjectv2.0 Release (Closed) => Pending Requests
2010-06-11 06:01caseydkProjectPending Requests => v2.1 Release (Closed)
2010-09-04 22:26caseydkProjectv2.1 Release (Closed) => v2.4 Release (Closed)
2011-06-07 22:16caseydkProjectv2.4 Release (Closed) => Pending Requests
2011-08-09 12:54caseydkProjectPending Requests => v3.0 Release
2011-08-19 16:42caseydkNote Added: 0002156
2011-08-19 16:42caseydkAdditional Information Updated
2011-09-27 23:25caseydkProjectv3.0 Release => Pending Requests
2014-01-01 17:02caseydkProjectPending Requests => v4.0 Release (Planning)
2014-01-21 17:57caseydkTarget Version => 4.0
2014-03-30 22:14caseydkCategoryGeneral => Core Infrastructure
2014-06-14 18:43caseydkNote Added: 0003484
2014-06-21 20:29caseydkNote Edited: 0003484bug_revision_view_page.php?bugnote_id=3484#r65
2016-12-26 10:25caseydkProjectv4.0 Release (Planning) => Pending Requests
2016-12-29 10:11caseydkProjectPending Requests => v4.0 Release (Planning)