Learning design patterns. Topic-Question

    Hello, Habrasociety. I write in a personal blog, since this topic is a question. So, most recently I took care of using sane design patterns in my fun applications and I met the first question that I could not google.
    The bottom line is this: let's say we have the domain objects “company”, “user”, “virtual file”, and “virtual folder”. Everything is more or less clear here - we create factories, data mapper and storages. But the creator of the file can assign file permissions to employees, and then you have to do an access check. The first thought is to pass the User object to the storage search method so that this method checks the access rights, but for me it looks barbaric. What if another part of the application wants to get some kind of file? Make an argument of type "User" optional?
    Revised Fowler, stumbled upon Service Layer. It proxies client access to domain objects. But he failed to google anything intelligible.
    Is acl part of the business logic? Should we distinguish between acl and the like from domain objects and their storages?

    Also popular now: