-
Notifications
You must be signed in to change notification settings - Fork 648
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Serviceクラスの設計について #694
Comments
#630 で、 Controller のメソッドを Service に移動していますが、 ShoppingController でしか使用していないメソッドなので、わざわざ Service に移動しなくても良いと思います。。。 |
@nanasess |
@nobuhiko 現状のプラグインの設計で、どれだけできるか精査できていないのですが、 Controller を継承するのであれば、 protected にしておけば問題ないかなと。 |
@nanasess 自分も今がどうなってるのかさっぱりわからないので、どうなのかなーと。 |
Service と Repository の違いもすごく気になります。 |
@ttsuru 勉強不足で、 Repository の概念をよく理解していない(Data Access Object と同義だと思っている)のですが、 Service とは性格が異なるはずなので、混在しているのは良くないですね。 |
@nanasess https://github.com/EC-CUBE/ec-cube/blob/master/src/Eccube/Service/OrderService.php#L229 |
なるほど、これは値が取得できなかったらシステムエラーになってしまいますし、 Repository で処理しなければまずいですね。 |
いろいろ調べてみると、 Repository と DAO の概念は異なるということがわかってきました。
参考) Repository という概念は、 Java でいうところの JPA や JDO にあたるものなのですね。 そういう観点からすると、 CSV や Yaml など、ファイル上のデータソースも Repository で抽象化して扱うのが正しいと思われますが、 Symfony ではどうなんでしょう?? |
4系になって、ステートマシンやPurchaseFlow等抽象化された部分があります。 |
public $app
も private で良いはず。The text was updated successfully, but these errors were encountered: