• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Riddle me this: When is a Session Facade not a Session Facade?

 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Answer: Apparently most of the time that it's used in J2EE.
According to MartinFowler.com, a "Session Facade" in the pure sense should not contain any domain logic whatsoever. Rather, it should simply act as something of a bulk-accessor (e.g., return a value-object assembled with data gathered from one or more entity beans).
The typical use of a "Session Facade" in J2EE is to do more than just access entity beans, such as to manage complex workflow. In this case, it is a misnomer to call it that. Rather, according to Mr. Fowler, it is a "Use Case Controller", which should not be confused with "Session Facade" as the two are seperate patterns.
I just happened upon this and thought I'd share... any thoughts?
http://martinfowler.com/isa/useCaseController.html
Cheers,
David
[ January 18, 2002: Message edited by: David Carel ]
 
author
Posts: 3892
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes, Martin's right. It coemes down to the fact that some people misapply the pattern. A facade has always meant a super-thin layer that only wraps existing logic. If there's new logic it ain't a facade; it's something else. In fact, I say the exact same thing in this article.
Kyle
 
David Carel
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello Kyle,
Your article is very enlightening; thanks for directing me to it. It's also very long, so I'll have to finish reading it later tonight...
I just visited your website and must confess: I'm enamored with the copious quantities of relevant and useful information there! Consider yourself duly bookmarked.
 
David Carel
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I find it peculiar that, given the precise definition of a Session Facade as a ultra-thin wrapper as you describe, Sun Press seems to champion a different creed. Is this a conflict between camps? Can't we all just get along?
From the article "Design Patterns for Building Flexible and Maintainable J2EETM Applications" located at http://developer.java.sun.com/developer/technicalArticles/J2EE/despat/
RE the Session Facade pattern: "This pattern is definitely not suitable if there is no workflow involved. "
Perhaps I should just accept the fact that if someone says "Session Facade", they more likely mean "Use Case Controller" and not be a fickle purist by insisting they use precise semantics.
[ January 21, 2002: Message edited by: David Carel ]
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic