odan / slim4-skeleton

A Slim 4 Skeleton
https://odan.github.io/slim4-skeleton/
MIT License
439 stars 80 forks source link

Not a issue but asking for help #67

Closed jlspshmily closed 3 years ago

jlspshmily commented 3 years ago

Hi Odan

This is not a issue but asking for help.

Maybe i should put it in Discussions but it is not enabled in this repository.

I'm trying to build a web application with an HTML interface by this slim skeleton, it is realy helpful to me.

Now i want to create a new table called user_profile to store the extra infomation for a user just like age,gender,address,phone nubmer,profile etc.

These fields will be shown in the samme page with username,role,email,enabled in the same page for view and update.

What am i wendering is how to structure the Domain layer.

Should i create a sub-folder named userProfile under folder Domain then create it's own Data,Repository and Server folders

or create UserProfileData,UserProfileRepository,UserProfileServices files under Domain\User\Data ,Repository and Service

or just merge the logic code into UserData ,UserRepository and UserService?

Is there any suggestions or best practice here?

Many thanks.

odan commented 3 years ago

Hi @jlspshmily

The answer to how to structure the domain and other best practices can be found in my Slim 4 eBook. Chapter: Architecture

jlspshmily commented 3 years ago

Thanks @odan , i'lll check it out.

esallum-iluminare commented 3 years ago

Hi Odan, I want to thank you immensely for this SLIM 4 skeleton that you provided to the community. However, I have a beginner's doubt:

By the ADR development pattern, let's assume I have a domain called Categories and another one called Subcategories with their respective Actions (following your SLIM 4 skeleton pattern). The Categories action returns the categories and the Subcategories action returns the subcategories for their respective routes.

However, I need a route that returns the subcategories with categories Following good programming practices, can I create an Action SubcategoriesWithCategorie (without any domain) and through this Action access the Categories domain and the Subcategories domain?

odan commented 3 years ago

Hi @esallum-iluminare Please create a new issue for new question.