Apidoc, debug and Yii 3 progress

(Alexander Makarov) #1


(Anas Jaghoub) #2

@samdark thanks for the update, I’ve a question regarding Yii 3, there’ll be advanced template skeleton ? where / when can I check it?

(Rustam Mamadaminov) #3

I think it will not

(Alexander Makarov) #4

No, there won’t be advanced-like template.

For now, there’s https://github.com/yiisoft/yii-demo

(Anas Jaghoub) #5

@samdark so for versioning what’s the approach expected? and in the case of multi-app project how it will be done? in Yii2 we used to. have backend. / frontend / and console by default. for the advanced template case. how it’ll be done in case of Yii 3?

(Anas Jaghoub) #6

@samdark I’ve checked the link you’ve shared for the demo, and have a couple of concerns if you allow me to raise.

  1. I’ve noticed the absence of model and instead using the Entity instead.
  2. I’ve noticed the use of *Repository to represent search ops to entities.

Currently I’m working on Spring Boot project and I’m using the same naming conventions and to be honest with you, the fact that having the Entity in a package and the Repository in another package is kind of extra sophistication and really would like to hear from you what’s the reasons to have it like this.

The other point what’s the benefit of renaming the model to Entity and ModelSearch to EntityRepository? is it kind of a trend / standard? or to comply with other frameworks in the field?

Finally I’ve noticed the long-param constructor in the AuthController.
public function __construct(ResponseFactoryInterface $responseFactory, Aliases $aliases, WebView $view, User $user, LoggerInterface $logger)

I’ve already talked about this point in my article here Yii vs Laravel a 2019 comparison

Where I’ve mentioned

IMHO I prefer to deal with controllers in the events like (Init/Before/After) and keep controller construction job for the framework itself.

Looking forward to hearing from you, and much appreciate to get your point of view as well.


(snuzi) #7

Is there any article explaining why repository pattern is used in the new Yii3 demo? And will this pattern be a standard in the Yii3?

(Alexander Makarov) #8


Just separate namespaces. You may divide into multiple applications yourself if needed as well.

No specific reason.

Because in computer science and patterns model means totally different thing. For example, in MVC model is not what model is in Yii 1 and Yii 2, it is a whole domain layer. That’s very confusing.

There is a plan to make it simpler.

(Alexander Makarov) #9

There is no such article. In short, it encourages separating data usage from details of obtaining data. Obtaining data is usually a bottleneck and when dealing with complex projects, non-standard ways of doing that are likely to be used (cache, getting data partly or fully from noSQL etc.). Doing such separation makes it easier to deal with performance problems without standing in your way too much at early project stages.

It is not a standard but a good practice. We do not require following it strictly.

(snuzi) #10

Thank you for the prompt reply. You are making a great work on this framework. To me it looks a bit unclear how the Entities will work, are you going to implement entities as data mappers like Doctrine does or we can still use AR?
In fact I would be interested to see how CRUD operations would look like in a project following your new pattern.

(Alexander Makarov) #11

It is not decided yet.