Search the Community
Showing results for tags 'repos'.
Found 1 result
So I was stumbling around with Repositories and Interfaces and got a decent grasp on it. However, I started running into abstraction and started to implement a little bit of the Factory design. How often is this typically used? It seems like I should be using Factory with 90% of my Repositories since there are different types of Items, Tutorials, Random Events, etc. Items - Food - Weapon - Toy Tutorials - Newbie - Farming Random Events - Coin Giving - Item Giving - Item Draining Things like this... so all of them have similar methods involved. So they each have a base method, for example.. an Item child class would always have the use() method and a factory would determine which kind of object to initiate from your controller just from the item model being passed through. So therefore you can call use() on the repository instance it returns. Then I was moving onto my tutorials and random events and it just seemed very similar. So in most cases, will factories be a huge plus? Just wanted some general opinions from the PHP developers =) Thanks!