I have doubt about difference between action dir and engine dir in AVR Framework.
Can anyone explain me what is the difference ?
I have doubt about difference between action dir and engine dir in AVR Framework.
Can anyone explain me what is the difference ?
Engine in AVR is equivalent to service in Symfony or Laravel. It should be "useful object" that performs single operation, example: MailSender engine should send emails, FileReader engine should read file contents. In case of more complex functionalities you should pass dependencies on another engines (or managers) through setters or through public method's arguments. Injecting dependencies through constructor is impossible, because constructor has no public access. Engine in AVR should implement business logic. On the other hand action should be an object that executes operations on another objects (engines, managers, items) and then it should prepare response that can be send to client or to box related with current action. And it shouldn't implement complex business logic! Action class in AVR is equivalent to controller methods in Symfony.