aspose file tools*
The moose likes Architect Certification (SCEA/OCMJEA) and the fly likes Questions regarding BaseController and other controllers Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Certification » Architect Certification (SCEA/OCMJEA)
Bookmark "Questions regarding BaseController and other controllers" Watch "Questions regarding BaseController and other controllers" New topic
Author

Questions regarding BaseController and other controllers

viv anand
Greenhorn

Joined: Jun 21, 2009
Posts: 29
Hi,
in my SCEA Part-2 assignment, I am showing a BaseController with <<Servlet>> stereotype in the class diagram. (This BaseController is actually the FacesServlet in JSF). I am also showing in the class diagram some other controllers like SecurityController, XXXController with <<ManagedBean>> stereotype. And I am depicting that the BaseController(which is a servlet) is using the other controllers(which are maanged beans).
I have the following questions:
1. Is this approach right?
2. I am showing the FacesServlet as BaseController and also naming the managed beans as Controller(e.g. SecurityController).Actually I am trying to follow Cade's example where there are BidController, NoticeController etc. Am I doing the right thing?
3. Following the Cade's example, in the Component diagram I am showing the related group of JSP's and Controllers as a single component (Though Cade's example has shown only the JSPs). Please provide your opinion about this.
Saket Mittal
Ranch Hand

Joined: Jul 26, 2011
Posts: 37
I think you are good on all counts as you are showing more information not less. I am not even showing JSF controller in my class diagram because it is not my class and my diagram is already cluttered. Calling managed beans as controllers is also fine as they are part of the controller of the MVC pattern.
viv anand
Greenhorn

Joined: Jun 21, 2009
Posts: 29
Saket, thanks for your reply. One correction- For JSF, ManagedBean is the Model of MVC pattern and FacesServlet is the Controller of MVC.

It will be of great help if other ranchers (like Saket) give their opinion. Please share your opinion.
Saket Mittal
Ranch Hand

Joined: Jul 26, 2011
Posts: 37
Why cant they be both ? Managed beans can be action handlers and action handlers are part of the controller along with the faces controller. They are also model because they could contain presentation data. Right ?
Nilessh Ganu
Ranch Hand

Joined: Dec 22, 2009
Posts: 100
viv anand wrote:Hi,
in my SCEA Part-2 assignment, I am showing a BaseController with <<Servlet>> stereotype in the class diagram. (This BaseController is actually the FacesServlet in JSF). I am also showing in the class diagram some other controllers like SecurityController, XXXController with <<ManagedBean>> stereotype. And I am depicting that the BaseController(which is a servlet) is using the other controllers(which are maanged beans).
I have the following questions:
1. Is this approach right?
2. I am showing the FacesServlet as BaseController and also naming the managed beans as Controller(e.g. SecurityController).Actually I am trying to follow Cade's example where there are BidController, NoticeController etc. Am I doing the right thing?
3. Following the Cade's example, in the Component diagram I am showing the related group of JSP's and Controllers as a single component (Though Cade's example has shown only the JSPs). Please provide your opinion about this.


I am using a single Front controller(which is FacesServlet) centrally delegating specific requests to more specific controllers. If we map this to Cade's examples, I am showing a Controller delegating the requests to BidController, NoticeController.
However I am not using the backing beans as controllers.

The idea behind delegating the requests to different controllers is to provide different custom pre/post processing of requests to each of the controllers.
Does it sounds good ?

Nilesh
SCJP SCWCD OCMJEA
viv anand
Greenhorn

Joined: Jun 21, 2009
Posts: 29
Thank you all for your reply . Yes, I think ManagedBean can act as a controller.
Medha Polishetty
Greenhorn

Joined: Aug 01, 2011
Posts: 14
This was good discussion and one question i have is this may be offrelated to the topic. Anyways I'm kindoff new to the JSF and from the examples what i have seen is ManagedBean/Backing can be used to display the data on the Pages. At the sametime are these beans can also be used as the controllers?

Sory If i posted my question in wrong thread.

Thanks,
Nilessh Ganu
Ranch Hand

Joined: Dec 22, 2009
Posts: 100
viv anand wrote:Thank you all for your reply . Yes, I think ManagedBean can act as a controller.

Looking at the post, I am convinced that class diagram should be framework agnostic. So I am going ahead with a single controller in the class diagram.
I am also not showing the managed beans in class diagram.

Class diagram:

JSF page >> Controller >> SLSB

Sequence diagram:

JSF page >> Controller >> backing beans >> SLSB

My assumption is that the Controller used here is Facesservlet.
Does this sounds good ?

Only question remain in my mind is are BidController/NoticeControllers shown in sequence diagram are some kind of backing beans?
Is the convention correct to name the backing beans as 'xxxController' ?

Thanks.
Gurukant Desai
Ranch Hand

Joined: Apr 07, 2008
Posts: 56
Nilessh, I think that should be fine by looking at Jeanne's reply in this thread.
http://www.coderanch.com/t/521637/java-Architect-SCEA/certification/Part-II-Cade-usage-Controller

Jeanne, Please confirm.
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 29275
    
140

Yes. I still agree with my opinion. Thanks for finding where I replied earlier .


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Questions regarding BaseController and other controllers
 
Similar Threads
Part 2 assignment level of detail
Some questions regarding part II
Passed part II + III with 98%
Showing StartUpController in the class diagram
Part II: Cade's usage of a Controller within the Class Diagram & the Sequence Diagrams