Recommendations I understood in Java (which has a lot of restrictions, @ least for me), even with hibernate was to have separated layers
- Entities like persons, children, users, etc...
- DAO entities linked to database
- Service providing entities and functionalities, where I'll do the SQL
- WebService providing an interface over needs
As I'm starting with Eiffel and store, I'm facing some difficulties I face since ever in programming (hoping there's somebody in this earth who has not the same problem) I always want to generalize things more than necessary. Every time I do a copy-paste, I refactor and look for a solution which makes me able to write it one time... which takes time and time on the delivery of the software, but for me adds more quality and flexibility to the software. I'm actually working alone in a company where I'm going to be the lead developer and if the future wants we'll be more developers. The goal is to develop a platform of services in Eiffel, postgresql-odbc, and an Angular-web front-end.
I'd like to have the more generic pattern to be able to manage entities in the future with typical situations as:
- Database entities
- Relationships
- one_to_one
- one_to_many
- many_to_one
- many_to_many
@ The point I'm now, I'm about to develop an architecture which ideally for me has:
- DB_ENTITY which as relations: BAG[RELATIONSHIP[P,S]] where P=Primary and S=Secondary
- Primary is P->DB_ENTITY when ONE and BAG[P] when MANY
- A COMPANY on my design will inherit from DB_ENTITY and add relationships as a BRANCH. So I was thinking having in my COMPANY class branches: RELATIONSHIP[like Current, BRANCH]
The relationship classes would help me to create the CRUD SQL statements into the "service" layer in a more abstract manner.
- when I try something more lightweight I find restrictions in the pattern where I have to repeat operations... thats a bit my difficulty
- Do you think of any disadvantages of such model I'm creating out of the first shot of development?