Override Joomla view logic class through plugin
On previous post, I wrote about overriding AcyMailing’s archive view class with the purpose of adding a custom field. It was done through alteration of component core file since layout-override only applies to view-output files. Later, I found a more sensible way to override the view class through plugin. In its simplest term, the plugin is used to include the modified view-class thus the original view-class never gets declared. This is possible because when the system instantiates the view class, it uses class_exists to load the respective class. When a class gets declared, the subsequent declaration will simply be ignored.
The following code demonstrates this possiblity. The code gets executed during onAfterRoute event and it does so by including archive.view.html.php
On a side note, the plugin xml file now accepts install and sql tag but does’t seem to accept uninstall tag. During the plugin installation, the sql runs okay but not during uninstallation. Otherwise, this AcyMailing field extender could be packaged into an installable plugin and that the alteration of database, view-logic files inclusion and output override can be seamless and automatic through plugin installer.
Reference : http://community.joomla.org/blogs/community/521-did-you-know-overrides-are-not-just-for-html.html