Alt-Org / Altzone-Server

REST API
8 stars 1 forks source link

Change idea for removing the forwardRefs. #304

Open PlayJeri opened 5 hours ago

PlayJeri commented 5 hours ago

I looked in to the architecture change we were discussing.

All the forward refs in the service classes were unnecessary. I had misunderstood the usage of the forward ref earlier and thats why it was in so many places.

Turns out we only needed it in item.module.ts for stock and clan modules and in room.module.ts for item module. The only circular dependency now is ClanModule -> StockModule -> ItemModule -> ClanModule. But all the services can be free of forwardRefs.

I published a branch change/architecture that has these changes now. The application seems to work normally and passes the same tests as the dev branch does.

So this might be a good first step towards the new architecture.

PlayJeri commented 3 hours ago

I also tried out the new Player won a game event flow you defined in the drawio diagram. I got it working so it might be a good choice. It still relies on forwards refs and circular dependencies so we need to make some changes to the module / service hierarchy but if you want to see the rough idea I published the branch change/new-gameData-event-flow.