oop - Appropriate way for business logic layer to deal with its neighbors? -


good morning, have use-case in project says if user isn't logged in application display warning message him , determines if user logged in or not managed bean called loginpagecode, class in business logic layer responsible determine if user logged in or not in order take decision displaying message(that action taken when specific action occurs in jsf page called home.jsf), thought of 2 approaches follows:

  1. make home page determine if user logged in or not , pass final decision business logic class
  2. make business logic class responsible determining if user logged in or not , require deal directly loginpagecode

i want know suitable way of doing point of design.

if business logic layer needs know if user logged in, should pass along information argument.

the business layer should not need know how user authenticated, if needs know if user logged in should given information -- that's separation of concerns you! :)

the main idea can reuse same business rules in entirely different environment, e.g, using different authentication mechanism.


Comments

Popular posts from this blog

Perl - how to grep a block of text from a file -

delphi - How to remove all the grips on a coolbar if I have several coolbands? -

javascript - Animating array of divs; only the final element is modified -