PHP: mantıksal kalıtım (uzanır)

0 Cevap php

Bu olmayan bir ilgili kodlama soru olarak gelebilir ama, doğrudan ilgili değil:

The facts: Ben oyuncuların (bir iş kurulu gibi) bir takım için arama yapmanızı sağlar (symfony ile) bir web sitesi geliştirilmiştir ettik. Bu bir modül sadece yapar.

The problems ben web sitesi bile daha doğru ve (örneğin, "League of Legends" oynamak isteyenler için onlar doldurmak için 3 daha fazla bilgi sahip olacak oyunda bağlı olarak her oyuncu için özel bir form yapmak istiyorum up ....)

The solutions?

Şu anda dikkate belirli oyunlar için belirli kriterler almak için maç başına 1 modülünü Gelişen ediyorum.

Advantages : The player enters the informations in relation with his game and does not see/interact the other criteria

Disavantages: 90% of the code are the same between each modules. It takes more time.


  • Inheritance

I never played with that before so i don't know if it's possible in my case to stick with 1 module for the entire game collection AND taking in consideration the specific criterias for games. In that case it would mean to have 1 template per game and displaying the right template with the right accessors like ($this->getCV()->getPseudo(); / $this->getCV()->getGame()->getSpecificCriteria1();)

0 Cevap