Molding A Child Into A Man

Let me peep into lanes of my bygone days’ memory. When an innocent boy of ten I was, I often override mom’s instructions. Never were these big or manly but ever childish Never leave the fridge door…

Smartphone

独家优惠奖金 100% 高达 1 BTC + 180 免费旋转




Leveraging The ORM

Use relationships to reduce queries.

Relationships are directives to the ORM that describe how one model is related to another. The most common of these is the “has many” and “belongs to” relationships. An author “has many” books, and a book “belongs to” an author. Tying the tables together in this manner creates SQL joins under the covers, making it easy to get related data.

By leveraging the features of the ORM, you can avoid writing prescriptive SQL language and focus on the business issue at hand. After all, “$book->author->name” seems rather intuitive and obvious in what it is getting at, without resorting to five lines of SQL.

When a new reader visits the code and sees “$book->author->name”, they don’t need to spend any time parsing the code to determine the intent. It’s clearly the name of the author of the book. When you compare this to old Java code with several lines setting up a JDBC connection and concatenating strings to form a SQL query, you realize how much simpler this is.

Add a comment

Related posts:

Fortune Gods God of Fortune

Fortune Gods from the Chinese kagaming camp said: The horse can’t bear the weight. If not fed with special animal feed at night A man cannot earn wealth without earning extra income. For centuries…

Gypsy Rose

The case of Gypsy Rose Blanchard is one of ghastly disturbance and obscurity. Dealing with a wide range of subjects such as Munchausen syndrome by proxy and first-degree murder. To the unfortunate…

Get taxi from Heathrow airport to Waterloo and Vist nature with ASSA CARs.

If you are planning to visit places in London, you can sit back & ASSA cars drivers show you the best of London as well as take you out-station with best fares & best cabs at your service. we have…