Support the ongoing development of Laravel.io →
posted 10 years ago
Architecture

Hello :)

I'm trying to improve my architecture implementings Managers and I have some doubts about what I am doing.

Here is my architecture :

| app
  | myProject
    | Repositories
    | Managers
    | Models
    | ...
  | ...
| ...

First, I have two classes - Group and Message. Each one does have a manager implementing theirs CRUD actions.

I would like to post a first message when a group is created. So, I was planing to inject the MessageManager into my GroupManager.

Then, I could call this, just after creating the group.

$this->messageManager->create($inputs);

My question is : Is that solution really scalable ?

I mean, if one day I want to create a Topic AND a Message, I should inject the TopicManager too. And let's imagine, I have not only topics to add, but three different resources. It involves three more Managers in my GroupManager.

What do you think about this ? Do you resolve this problem another way ? :)

Last updated 2 years ago.
0

Any thoughts ? :)

Last updated 2 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

EpiK38 epik38 Joined 16 Jul 2014

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2025 Laravel.io - All rights reserved.