What does the expression factored forward mean? Is there some J2EE significance to this term? Thanks. - satya From the Sun Quiz of JSP Arch.
What type of scriptlet code is better-suited to being factored forward into a servlet? A. Code that deals with logic that is common across requests. B. Code that deals with logic that is vendor specific. C. Code that deals with logic that relates to database access. D. Code that deals with logic that relates to client scope.
I haven't heard that before. This questions are based on JSP Professional from Wrox and related chapter 12 has "factored" word on page 317 318 and 329. "factored" in 317 and 318 are under section called Code Factoring and role seperation
page 318 We will also want to remove much of our business logic and data access code from our JSP page and encapsulate it within JavaBeans, called Worker or Helper Beans.We start to see a pattern of code movement from our JSP into two area: Servlet ( or JSP ) that sits in front of the JSP { Comment:this sound like a Front Controller pattern or Intercepting Filter to me Does Wrox like to call it Factored Forward ? } and JavaBeans that sit in the back { Comment:is this a Business Delegate,DAO, Service Locator ? Does Wrox like to call it Factored Back ?!} We refer to this common pattern as "Factor Forward - Factor Back" as shown in the figure :
Another way to think about where code should be localized and encapsulated is that our JSP page should reveal as little as possible of our Java code Implementation details. Rather , the page should communicate our intent by revealing the delegating messages we send to worker beans, instructing them to get state from a model , or to complete some business processing.
IMHO ,I guess this is Wrox invented name , I did not see it in the Core J2EE Patterns book, ( of course this does not make it invaluable. So this sounds like putting logic , access to bean " factored back " or using a dispatcher approach with servlet "factored forward" the thing is being factored is code the I think. factored: to resolve into factors factor: one that actively contributes to the production of a result
Every body wants to own a pattern nowadays : They are cool Dude [ January 10, 2002: Message edited by: ersin eser ]
ersin eser
Ranch Hand
Joined: Feb 22, 2001
Posts: 1072
posted
0
Satya Read their pdf file for Chapter 12 page 317-318-329 this new UBB is driving me nuts !! [ January 10, 2002: Message edited by: ersin eser ]
Madhav Lakkapragada
Ranch Hand
Joined: Jun 03, 2000
Posts: 5040
posted
0
Sure will. Thanks. - satya
Ram Dhan Yadav K
Ranch Hand
Joined: Aug 13, 2001
Posts: 321
posted
0
Factoring forward may be some thing related to code factoring done to make the code more OO compliant, more realdable, more manageable. Probably they are expecting what sort of code can be factored out from the jsp into a servlet. Ramdhan YK
Ram Dhan Yadav (SCJP, SCWCD, SCJA-I, IBM EC(483))
"We are what we repeatedly do. Excellence, then, is not an act, but a habit."
Roseanne Zhang
Ranch Hand
Joined: Nov 14, 2000
Posts: 1952
posted
0
Originally posted by ersin eser: this new UBB is driving me nuts !!
agreed! But I found a way to get around it. Just post as before, and ignore all the "new features" Roseanne
And Madhav, what abt the answer of this question u think? I would have gone for (A)...
Ashik Uzzaman Senior Member of Technical Staff,
Salesforce.com, San Francisco, CA, USA.
Madhav Lakkapragada
Ranch Hand
Joined: Jun 03, 2000
Posts: 5040
posted
0
Ashik: You are correct. A is the answer. This is part of the qstn I got in the Sun Sample test. Initially I selected "A" then while reviewing I thought "C" would fit well. Since generally DB Connections etc are better in Servlets as it is pure Java Code. But then that was wrong. So, "A" is the correct answer. - satya