Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I didn't quite understand it. From your example, it looks like ORM layer knows about 'pages', which are in views. Isn't it against clean separation of concerns?


It doesn't know about pages, it knows about the stack trace that resulted in a query being generated, e.g. it know that a specific method in the ProductController called a specific method in the ProductService, etc, leading to a query being generated.

It also know which fields of the object it returned were accessed prior to going out of scope and more importantly, which fields were never accessed. With those two bits of information gathered over many calls it can figure which fields are actually worth fetching from the database and which should be left off and fetched lazily in the odd case that they are needed.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: