Hi guys,
my problem is that we try to use a MVC (php) framework. After discussing a lot think that MVC is very good, but I´m missing the possibility to write reusable model-(application)logic. So, I´m not sure if we have the right approach to implement our software in a MVC framework.
First I´ll describe the non-MVC, oo-approach which we use at the moment.
For example - we are working on some browsergames (yes thats our profession). Imagine we have an player object. We use this player object very often. We have some different pages where you can buy thinks, so you need to make "money" transactions on the players "bank-account" or imagine you can do fights against other players. We have serveral fight-scripts, and these scripts take 2 or more player objects (it depends on the type of battle ie. clan battle, player vs. player battle...).
So, we have severel pages (and controllers) with different battle-logic. But each of this controllers use the player-object to calculate all the attributes and items a player has and which damage and defense a player will do.
so, how can we reuse the logic in the player object in case of a MVC Model? it would be bad to duplicate all the nessecary logic in the different fight-controllers and -models.
i think the "gold-transaction"-logic would be a good example to give you some more detail information. you need the transact-function in case of a fight, if you win against an other player and loot some of his gold, you need the transaction function in case of buying some stuff and you need the transact-function in case of spending some gold to the players guild.........
so, i would say it would be a bad approach to define all these functions in one player model! I can say you these player modell would be very big (actually we have the problem that our player-class is really huge - its a god class)
do you think there is a MVC-style solution for this problem?