Welcome Guest, Not a member yet? Register   Sign In
Some help with MVC good practice
#11

[eluser]n0xie[/eluser]
[quote author="iConTM" date="1282185914"]
I feel I'm writing to much code inside a controller.

Any tips on good practice?

tx[/quote]
Use Base Classes. If your model does basically the same thing every time, move the functionality to a base model and let them extend from there.
The same for Controller Classes. If you have a bunch of 'standard' function, move them to the base class, then if need be, extend and/or overwrite them.

Remember that the idea of OOP is to find the common ground, abstract that away, and only bother with the 'differences'.
#12

[eluser]iConTM[/eluser]
[quote author="n0xie" date="1283439438"]
Remember that the idea of OOP is to find the common ground, abstract that away, and only bother with the 'differences'.[/quote]

I made one abstract model for the CRUD and
I'm really satisfied about it Smile.

thanks




Theme © iAndrew 2016 - Forum software by © MyBB