Some think about Facadelayer

xiaoxiao2021-03-06  116

A few days ago, the code of the Project, seeing the data layer directly in Facade, which means that Facade and BusinessLayer merged into a layer of but the name is Facade. Although some have little twists, the project is not large, the operation of the background is mainly a simple Curd, and most of the logic of a slightly complex logic is encapsulated in the stored procedure, so the processing of the merge layer is not very uncommon.

When I think further thinking about Facade, I remembered a project that I have done before in order to implement a Facade's interface, I need to call multi-step background logic implementation (I really do this). Is this call logic not counting business logic? If I do this, do you scatter your business logic into your facade (clearly, don't contain business logic in the true Facade)? How to distinguish between calling logic is not commercial logic?

And LEON, Lee made a discussion, I think Lee said "The logic of the call should be encapsulated inside Businesslayer, and finally the result is only the result", which should be the most acceptable point of view. Then I saw Duwamish (where I met FACADE words there), it is indeed only to forward the message to the businesslayer, and may contain the configuration and check of the parameters.

Inside the reconstruction, this method should consider it if it is only the actual operation of the forwarding message. Facade is more special, SOA's Service Interface.

转载请注明原文地址:https://www.9cbs.com/read-125707.html

New Post(0)