Why are entities and repositories put on global module?

Hi all.

Files that have written entities is put on ‘/lib/myapp/entities/my_entity.rb’. Thus I think MyEntity is put on MyApp::Entities module.

So, I think my_entity.rb is following.

class MyApp::Entities::MyEntity
  include Hanami::Entity
  ...
end

But actual MyEntity is put on global module and my_entity.rb is following.

class MyEntity
  include Hanami::Entity
  ...
end

Repositories are also same.

Why is this?

My thoughts regarding this issue is simple. Your container application should be concerned about layers for dispatch, authorization and validation (exactly about namespace for MyApp). After that, we’ve layers for business logic and persistence.

Those last layers aren’t coupled and this is really good. The hanami-model gem isn’t coupled with the first layers that I said. And what I said is what makes sense to me.

But, I really want to know what are the thoughts of the core team.