D
D
dmitriy2016-09-10 11:19:22
PHP
dmitriy, 2016-09-10 11:19:22

Code first or database first?

What approach do you use, is it possible to go code first without Doctrine?
I'm trying a design and development approach based on business entities without using a database. At this stage, you can use acceptance testing, check the operation of the final functionality without a database, use temporary data from pre-created stubs. Development and design of the base can be carried out in parallel.
But after that there are problems with the implementation of the storage logic in the database. I heard that Doctrine ORM is well suited for these tasks (datamapper pattern), is it possible to do without it, is there a simple datamapper tool?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
A
Alexander Aksentiev, 2016-09-10
@Sanasol

This is not a layout for you, where you start with which version you want.
What are you going to codefurst without a base? Randomly without running the code and checking the work at all? Or how?
What about working with entities without entities?
Doctrine is not a base, but an ORM.
With the same success, you can write code on a piece of paper, there will be about the same benefit.
app.
Abstracting from a specific database != don't use the database as such in development at all.
If you want flexibility for *Sql solutions - use ORM and don't sweat your brain.
If you want to use any magical things at all - write on adapters.
But I think that you do not need and will never be able to put anything directly instead of a regular database. So it's not worth it. Take MySql/Postgre and write code normally.

V
Vicom, 2016-09-10
@vicom

Pavel Volyntsev , Alexander Aksentiev
, there is a feeling that people just want to implement and tune BL with emulation stubs in CRUD functions in the lowest layer of the level of manipulations with atomic (within the domain) storage entities, and it is difficult for him to do this, because he thinks on the wrong side of the world.
diamond it is possible, but in this case I won’t even assume what pitfalls,
despite the fact that in theory, initially you should win, but at what cost .. at least even in terms of time
and resource costs for adapting the project to the existing general development ecosystem , adopted
today around the world and relevant knowledge and developments available to a wide
public on the basis of established practices. I think you should write several ready-made projects, and
then it will be easier to see the system in different projections, sections and degrees of freedom (the concepts of BE / FE depending on the context, how business tasks are performed by bricks and based on them, systems
already perform global tasks based on their business -rules, which components at what levels and how they interact), and then it will be easy for you to draw cubes in the BPMN style in your head with reference to reality and without fantasy
, this is just my guess. for advice, I think it’s better to Pavel Volintsev , the person has a good portfolio

P
Pavel Volintsev, 2016-09-10
@copist

As a system designer from the ground up, I always start with database design and precede that with domain analysis. It is advisable to design a data model not only for MVP, but also two or three steps ahead, looking at the project roadmap.
Video: analysis of the subject area and construction of a relational one ...
Of course, you also have to finish building on the go, but to write code without a database is to stick a spoke in your own wheels, as it seems to me.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question