The front-end interface is the equivalent of a real estate developer, and the controller is the equivalent of a small secretary, communicating the developer's requirements to the service layer.
The little secretary burst into a rage, seeing that the developer said he wanted to build the building without paying (the parameter is null), so angry that he directly cut off the unreasonable request, and gave the building plans to the building workers.
The service layer is where the hard-working house builders, after getting the house drawings from the little secretary, start building the house.However, the builder goes through his pockets and finds that there are no screws, no screwdriver, what to do? Definitely go to the hardware store!
At this time capitalist mysql came along, rummaged through the warehouse, found various screws and screwdrivers (entity class layer) and sold them to the service layer.
The service layer take a look, it won't work, the little secretary's drawing says five centimetres of screws, and you give me ten centimetres of screws, what do you mean? I don't deserve it?The indignant service took out the saw and sawed the nails short, and screwed on the screw caps and added bricks, which became the model layer as soon as it was capped.
The decorator gave the model to the little secretary, who looked happy and called the decorator.
The front end is the renovator, see this model and start renovating.
Once the renovation is complete, it's time to turn this building in.
The ideal is rich, the reality is boney. Throughout the actual process, it is inevitable that someone will be lazy, possibly a small secretary, possibly a house builder.Maybe the builder took a look at the drawings and thought, "Who the fuck is this? So the little secretary could only build her own house with tears in her eyes.It is also possible that the builder of the house can see what a ten centimeter nail can do, and I will force the nail into it.
But when he got himself into pain, the unreasonable house builder scolded the unscrupulous mysql, and said that I just don't pay or want to go for nothing.From now on, the house builder directly from mysql, grabbed, hard to insert screws, entity layer exist and die.Whether the builder is angry or lazy, or the secretary is exhausted, the developer just sees the house.
The people who bought the house don't know how to develop it, just live it.
One day, when the residents themselves renovated the house, they found that the house is a little crooked, the nails are a little long, the floor tiles are uneven, even the toilet is bad.But the tenants with super endurance persevered, the house crooked old man slanting look, nails long old man hanging a painting, floor tiles not flat old man as a slide.
But the toilet was broken.......
Finally one day, the sewer in the house is completely broken from being left unrepaired for too long.The toilet gurgled and scared the occupants.
In their horrified eyes, there's yellow stuff spilling out......
People passing by snickered at the sight: "What a fucking mountain of shit".
It didn't deserve to be written by me until I finished writing it and realized that I missed the DAO layer.