Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

a question about Change Itinerary UseCase

 
qin niq
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi ranchs,I am confused in Change Itinerary UseCase.
Can I use one class to implement both PrepareItinerary UseCase and ChangeItinerary UseCase.
In my worked projects every UseCase implement by one class or some classes independent.In this assignment,I think use ItineraryManager(a StatefulSessionBean) and some others classes to implement PrepareItinerary UseCase,I think the itineraries like a cart,of crouse a customer can have lots cart.
So add segment to Itinerary or deleted segment from Itinerary ,like add item to cart or remove from cart.I can use a manager class process the add and deleted segment act ,that mean use one class to implement both PrepareItinerary UseCase and ChangeItinerary UseCase.
,but in my work experience I have never done it like this.
ranchs,help me pls
 
Theodore Casser
Ranch Hand
Posts: 1902
Hibernate Netbeans IDE PHP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can do anything you wish with the design of the application, so long as it fulfills the requirements. That's the beauty of this exam being a project rather than multiple-choice. The only requirement is that you can explain why you chose to follow the patterns you chose.
 
qin niq
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Theodore Casser,
Thanks for your suggest.
 
Dominik Smith
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hahaha! Sure you can implement the whole system in just one class! Too bad BASIC is not a J2EE standar cause you could use that as well. I would also suggest using a whole bunch of gotos - I heard that people who mark SCEA assignments are crazy about them. Good luck in your architecture career!!!



OK, sorry - long day at work. Maybe you want to rethink the "one class" approach...
 
Ali Reza Hosseini
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
actually, refering to the j2ee core patterns book, sun recommends not to build a class for each use case but put similar usecases together in one single class (session facade).

so feel free to put several usecases in one class, if in your
opinion that they semantically belong together.
 
Theodore Casser
Ranch Hand
Posts: 1902
Hibernate Netbeans IDE PHP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Dominik Smith:
OK, sorry - long day at work. Maybe you want to rethink the "one class" approach...


Well, your sarcasm aside (and I did appreciate the goto humor), I think you're taking my advice too far. I certainly wasn't saying to go 'all out' with the one class approach, but that it could be an acceptable answer to the assignment with sufficient documentation. I wouldn't design it that way, no, nor did I. But I did have several use cases utilizing the same classes for carrying out various pieces of similar functionality, so...
 
Ajai
Ranch Hand
Posts: 198
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't see anything wrong with one class unless more than one use cases clutter the class.In fact we can have one facade with no of app services .

Thanks
 
qin niq
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for every advice, both gentle advice and sharp advice.I am very appreciate all your advice They made me integrity ,thanks.

Actually I have decided use ItineraryManager(a StatefulSessionBean) and some others classes to implement PrepareItinerary and ChangeItinerary UseCase since read Theodore Casser reply.

In my design,a PayProcessor(StatelessSessionBean) and some helper for PayforItinerary UseCase;a CustomerManager(StatelessSessionBean) and some helper for login an create profile;two helpers for Price and search; and a facade(Stateful) in front of the three SessionBeans and two helpers.

That is my design original shape,I like anyone is agreeable to it or opposed to it and expect your advice.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic