Changing method signature according to the new business logic

Dear java community,
Recently I'm confronted with one issue and I want to know your opinion about this.
ISSUE DESCRIPTION:
In one of my business tier class I had method register user:
public RegistrationStatus registerUser(User user, RegistrationType type, boolean confirmationRequired) throws MyBusinessException;According to new business rules I need to add 2 arguments to this methods (boolean isCustomBank and String customBankName).
All arguments in method are mandatory and I need them in registration process. It is also possible that in future it would be needed to pass more arguments to registerUser method (according to changes in business logic).
POSSIBLE SOLUTIONS:
A) Create userContext (as map) and collect there some arguments that needed in registration process (it would be used not only in this method, so it also would contain some other arguments not needed in registration). Signature of this method would look like this:
public RegistrationStatus registerUser(User user, RegistrationType type, Map userContext) throws MyBusinessException;Invocation would look like this:
Map userContext = new HashMap();
userContext.put(UserCostants.CONFIRMATION_REQUIRED, form.isConfirmationRequired());
userContext.put(UserCostants.CUSTOM_BANK, form.isCustomBank());
userContext.put(UserCostants. CUSTOM_BANK_NAME, form.getCustomBankName);
myRegistrationService.registerUser(form.getUser, form.getRegistrationType(), userContext);And UserCostants:
public interface UserCostants {
   String CUSTOM_BANK = "customBank";     
   // other constants
}B) Create userContext (as class � wrapper of map from previous solution) and collect there some arguments that needed in registration process (it would be used not only in this method, so it also would contain some other arguments not needed in registration). Signature of this method would look like this:
public RegistrationStatus registerUser(User user, RegistrationType type, UserContext ctx) throws MyBusinessException;Wrapper class:
public class UserContext {
   Map userContext = new HashMap();
   public Boolean isCustomBank() { return (Boolean) userContext.get("customBank"); }
   public void setCustomBank(Boolean customBank) { userContext.put("customBank", customBank);}
   // other get and set metods
}C) Create value object UserRegistrationData that would hold data ONLY for user registration method. Example of the signature:
public RegistrationStatus registerUser(User user, RegistrationType type, UserRegistrationData registrationData) throws MyBusinessException;And value object class:
public class UserRegistrationData {
   public boolean customBank;
   public boolean confirmationRequired;
   public String customBankName;
   public boolean isCustomBank() { return this.customBank; }
   public void setCustomBank(boolean customBank) { this.customBank = customBank;}
   // other get and set metods
}D) Just add new arguments to method's signature:
public RegistrationStatus registerUser(User user, RegistrationType type, Boolean confirmationRequired,
                                       boolean isCustomBank, String customBankName) throws MyBusinessException;E) your solution....
QUESTIONS:
I don't tell you my opinion and pros and cons because I want to know your independent opinion.
Which of these solutions are good and why do you think they are good?
Which of these solutions are bad and why do you think they are bad?
Thanks.

Hi ,
I thought of you overload that method and add into the Map.
Its best solution, even we use the same scenario in my application.
Thanks and Regards
Maruthi.

Similar Messages

  • Can i change my old ipod to the new one with priceless

    I have an ipod, they said ipod touch 3 8gb, they said... Now i can't do anything with this because too many apps require IOS >4.2.1
    So i have a question: Can i change my old ipod to the new one with priceless.
    Thanks for reading
    p/s: im living in San Francisco now

    CookPu wrote:
    If you know, please answer my question
    TFR
    Wow! Give us a chance!
    I live in the UK (about five minutes drive from the Olympic cycle race route. Didn't you notice me waving to the cameras? ). Not far from you , but far enough away that I might be doing something else, even if the cycle race has finished. The same applies to everyone else too. I'm eight hours ahead of you, so if it's 9pm now, where you are, it's five in the morning where I am and most of us here will still be inspecting the inside of our eyelids!
    Now, about your problem.
    If your iPod is 8GB, then it is not a 3rd generation Touch - no matter who they are and no matter who said it was! If it has model number A1288 etched into the casing on the back, then that identifies the 2nd gen Touch. (Yes, there is a 4th gen Touch in 8Gb capacity, but still no 8GB 3rd gen - ever). The third generation is model No. A1318.
    Can i change my old ipod to the new one with priceless. I don't understand what that means, unless you mean "with the price difference". In which case, the answer is "no".
    Even more confusing is; Now i can't do anything with this because too many apps require IOS >4.2.1 because -
    a 2nd generation Touch (including the 8GB) can install iOS 4.2.1 But that's as high as it can go. So that's incorrect! 
    you can still use any App that doesn't require a higher iOS than you have. So still incorrect!
    you can still use it as a music player, so guess what, wrong again!
    ... to store your photos - you know what I'm going to say now, don't you?
    ... and play those videos!
    So wrong, wrong and wrong!
    Message was edited by: the fiend

  • Can i change my old iPad with the new one, i Will pay the difference... Do you have this kind of program?

    Can i change my old iPad with the new one, i Will pay the difference... Do you have this kind of program?

    If you are past the return date, you can sell the older iPad and put the money towards a new one.
    Plus, old iPads make great gifts ! ! !

  • Why is the arrow changed in a cross in the new Camera Raw?

    Why is the arrow changed in a cross in the new Camera Raw? The arrow pointed exact on the chosen place. The cross hides your choice too much.

    Hi fonsmm sim,
    You are at wrong forum, post your question at http://forums.adobe.com/community/cameraraw
    Thanks,
    Sham

  • I changed my gmail password after suspicious activity was detected.  It works fine on my computer but my iphone 5 doesn't recognize my new password ("cannot get mail" message).  I've tried changing my phone settings to the new password, but no good.

    I changed my gmail password after suspicious activity was detected.  It works fine on my computer but my iphone 5 doesn't recognize my new password ("cannot get mail" message).  I've tried changing my phone settings to the new password, but no good.

    Hello there dinadinadina,
    It sounds like you have modified the password settings for your Gmail account after changing the password. Thats where I would have started too. Next I would restart the device and test it one more time, and then remove and add the account again in Settings:
    Get help with Mail on iPhone, iPad, and iPod touch
    Restart your iOS device.
    Delete the affected email account from your device.
    Tap Settings > Mail, Contacts, Calendars.
    Tap the affected email account.
    Tap Delete Account.
    Add your account again.
    Thank you for using Apple Support Communities.
    Take care,
    Sterling

  • I changed my password and used the new computer, next time I tried to log in it wouldn't accept the password. I tried the old one as well but that doesn't work either. Can anyone help?

    I changed my password and used the new computer, next time I tried to log in it wouldn't accept the password. I tried the old one as well but that doesn't work either. Can anyone help?

    Boot to the Recovery HD:
    Restart the computer and after the chime press and hold down the COMMAND and R keys until the menu screen appears. Alternatively, restart the computer and after the chime press and hold down the OPTION key until the boot manager screen appears. Select the Recovery HD and click on the downward pointing arrow button.
    When the menubar appears select Terminal from the Utilities menu. Enter resetpassword at the prompt and press RETURN. Follow instructions in the dialog window that will appear.
    Or see Reset a Mac OS X 10.7 Lion Password and OS X Lion- Apple ID can be used to reset your user account password.
    Be sure to open Keychain Access and repair the keychain:
    Assuming that you are using a recent build of OS X, go to /Applications/Utilities and launch the app called Keychain Access. Go to the Window pulldown menu and select "Keychain First Aid". Enter your password, set the radio button to "Repair", and click "Start".

  • I have a site published that i need to change, but when i publish the new pages it dosen't change the site that's already published. How do i remove the old site?

    I have a site published that i need to change, but when i publish the new pages it dosen't change the old site.

    See if this helps you any further :
    The concept of Sites in iWeb
    Also, clear the browser cache and reload the page(s).

  • My ipad is syncing notes to an old phone with a different apple id how can I change it to sync to the new iphone icloud is off and so is home sharing

    my ipad is syncing notes to an old phone with a different apple id how can I change it to sync to the new iphone icloud is off and so is home sharing

    Apps and Music are not from iCloud. Are from iTunes and App Store.
    You can change this from: Settings>iTunes and App Stores>Sign out and sign in with new ID, but you will have to pay again to download apps that you already have in your old account. Or leave it as it is to share purchases with your son.

  • The new business model?

    The new business model is inflexible. It might be suitable for many scenarios, but I will be looking for alternatives to Photoshop and the Premiere, wherever possible. This subscription model could be a boon to some businesses; Adobe will ultimately loose both long-term customers, as well as potential new users. A bad move overall.

    [email protected] wrote: A bad move overall
    Dcolive wrote:
    compared to tens of thousands if not hundreds of thousands of product users.
    I'm quite sure the user base is in the millions.  And I can't find the reference now because of the flood of buzz about the announcement, but it seems to me I read that the number of Creative Cloud subscribers is already quite huge.  I'm not sure your personal opinions are correct, given the wild success of the program already.  Stockholders have noticed.
    The short and simple fact is this:  Adobe's got the goods; professionals want the goods, and will pay for them.
    Yes, it's more expensive for a casual photographer to subscribe than it has been to upgrade to every other version of Photoshop Standard, and there is the limitation that you don't get to keep using an old version of Photoshop once you've terminated a subscription, but it's a professional product suite, and people who truly need it pay for it.
    Perhaps Photoshop Elements is worth another look.
    Yes, it may sting to learn that you can no longer afford the top-of-the-line graphics editing tool, but...  How many of us can afford top-of-the-line anything?  Do you have the top-of-the-line camera from your favorite manufacturer?  How about your computer?  Your car?
    I think something that would help ease a lot of minds is a reasonable exit strategy.  One that shows some appreciation by Adobe for your having been a cloud subscriber.
    What if, for example, after 2 years of keeping your subscription current you were allowed to continue to use any released revision of Photoshop 2 years old or older upon terminating your subscription?
    -Noel

  • I have downloades Logic Pro 9 onto my older modfel Mac Book Pro 1,1 with OS 10.6.8 and 2 GB RAM, according to the rquirements for Logic 9. the program should run, but it won't open. Is my configutation too slow?

    I have downloades Logic Pro 9 onto my older modfel Mac Book Pro 1,1 with OS 10.6.8 and 2 GB RAM, according to the rquirements for Logic 9. the program should run on OS 10.6.8. with 2 GB RAM, 4 GB better, but it won't open. Is my configutation too slow?

    Looks as if you're just at the minimum specs - http://www.apple.com/logicpro/specs/. Says 2GB minimum, 4GB recommended. And 2GB of RAM is all the RAM the 1,1 can handle. If I were you I would call Apple's App Store service center - you have the minimum requirements, as I read it, but perhaps you need a faster processor?
    I had a 1,1 but sold it when I bought my late 2011 in March of this year - maybe it's time to look at a new machine?
    Clinton

  • I changed my ipad in warranty: the new one has a big problem!!

    I sent my ipad in warranty two weeks ago because of a problem with Home button.
    The new one has a bigger problem: the battery has a duration of maybe 1 hour!! I mean: i charge it, then i unlock it in order to run Safari. When i start the app, the buttery goes from 100% to maybe 93%.
    Other example: this morning it had 13% of battery. Just unlocking it, and using it to read some mails, the buttery went after 10 minutes to 3%!!!!!! it is absolutely unacceptable!!
    I tried so to go to the website of Apple, to order another changing of the iPad, but finally it gave me the error: Sorry, but you can't do this transition at the moment. Try again later o use the assistance centre. This since two days ago. How to solve it?
    I even tried to call the assistance centre but it said that all operators were busy, so i had to call later. and i did: every time the same...

    Using the battery level meter in this manner is comparable to using your car's fuel gauge to calculate miles per gallon.  The only thing that matters is the total amount of operating time from full charge to auto-shutdown (ignore any low level alerts that may appear).
    An irony is that doing a test (per the above procedure) to determine the total operating time is also the exact procedure necessary to calibrate the battery level meter.
    I'm not claiming that you do not have a problem.  I am stating, however, that we don't yet know whether or not a battery problem exists.

  • Change default CardType on adding a new business partner

    Hi everyone,
    I have a simple question, but I can't find the answer on the internet.
    I would like to change the default selected type on the form when I create a new business Partner.
    At the moment when I am in "add mode" the comboBox type ( corresponding to CartType in DB) has the value "Customer" selected by default. I want to change that default value by "Lead".  See attached image.
    Is it possible to do that?
    Thank you for your help!

    Hi,
    Not possible to change default value.Please refer below:
    Thanks & Regards,
    Nagarajan

  • Question about changing method signature

    Hello. I've inherited some code which contains a method with the following signature:
    foo(int x, MyObject myObject)
    Okay, so that's not really the exact signature :) In any case, I need to modify the signature to:
    foo(int x, Object myObject)
    I believe that I can do this without affecting any existing client code because Obect is a superclass of MyObject. Is that right or must I deprecate the first version and add the second separately? Whatever, happens I can't break code which was compiled against the old version. Thanks in advance.
    -jason

    That's a good point. It's probably not an issue
    however as we don't provide (supported) access to our
    implementation classes. Thanks for the input.
    -JasonThen I don't see another issue with it, as long as no other internally-written class has already overridden it and doesn't get changed at the same time. In a sense you're saying it's a "private" (not necessarily in the same sense of the private keyword) method, so you can change the implementation, including method signatures, at your whim.

  • Change display language according to the user programmatically

    How to change the site displaying language according to the user ? Let say I've drop-down to select language in a web page according to that whole site display language change and also user's language in user profile need to change. How to do that in using
    server object model programmatically.

    Hi,
    According to your post, my understanding is that you wanted to display language according to the user.
    First, we can find out the current culture of the logged in user based on
    LCID.
    System.Threading.Thread.CurrentThread.CurrentUICulture.LCID
    Then you can set the language based on the LCID.
    http://social.msdn.microsoft.com/Forums/sharepoint/en-US/0e5d36e1-ec06-404a-ab2c-0e0ff475abec/how-to-change-the-language-based-on-log-in-user-programmatically-in-sharepoint-2013-how-to-change?forum=sharepointdevelopment
    http://sharepoint.stackexchange.com/questions/104140/change-site-display-language-according-to-the-user
    Thanks & Regards,
    Jason
    Jason Guo
    TechNet Community Support

  • Transitioning sites to the new Business Catalyst rendering engine (BC.NEXT)

    The beta test I did resulted in a broken site I tested it on
    This is unacceptable implementation practice, unfortunately typical Adobe bulling partners
    What is also disappointing is the cowardly management practice of making this email announcement on the Saturday of a long weekend prior to the implementation.
    Totally lacks respect for Partners.
    Customers paid in good faith for sites, it is very inappropriate that Adode BC screws sites on a platform that was sold to us as partners as able to move forward without compatibly issues
    Be ashamed BC management ,very ashamed
    so what happens now to broken sites!

    Email received 0624am AU EST Sat 42 01 2015 
    Live chat was unavailable on the Saturday morning, tried several times and it did not display
    Will just wait til the dust settles and see what happens with other clients. No time to bother with this sort of supplier management planning and notifications attitude
    Starting Wednesday, January 28th, we will begin gradually transitioning the Business Catalyst sites to our new rendering engine.
    Already used in production by thousands of sites, this new engine is faster, more reliable and gives you access to additional functionality like named parameters for modules, Liquid language support and increased SEO score by enabling browser caching for static assets, plus our new admin editor with HTML 5 support and enhanced code view (in the beginning, we'll deploy with those features set to off but they can be enabled via the Beta Features page). As part of the transition, new features or enhancements will only be included in this new system engine.
    The transition process starts on Wednesday and will be completed towards the end of this spring, when the current rendering engine will be decommissioned. It will be a multi-stage process that is looking to gradually move sites while limiting the customer impact. You can find below the transition schedule:
    •    Milestone 1 (Jan 28, 10:00 AM UTC): Existing trial sites & all sites on webBasics and webBasics+ plans will be transitioned to the new engine. Additionally, all new trial sites will be created on the new engine.
    •    Milestone 2: All sites on the webMarketing site plan
    •    Milestone 3: All partner sites
    •    Milestone 4: webCommerce sites located on the EU datacenter
    •    Milestone 5: webCommerce sites located on the AU datacenter
    •    Milestone 6: webCommerce sites located on the NA datacenter
    •    Milestone 7 (late April): All remaining sites will be switched to the new version; the current version will be decommissioned.
    Note: The dates of the next milestones will be announced in time on the Site Transition Schedule page, based on the progress of the transition. We estimate that all sites should be fully transitioned to the new engine no later than mid Q2 this year.
    The move does not include any updates to the admin user interface that will impact your customers and should not have any impact on the site up time, performance or functionality either. Partners will be able follow an updated transition schedule by visiting the Site Transition Schedule page and subscribing to the transition plan email alerts.
    Even if we we'll transition the sites automatically, we strongly encourage you to see how the sites behave on the new engine before it's actually scheduled for transition (you can enable temporarily a website to be rendered on the new engine, just for you, from the Admin Console Beta Features page). This will give you more confidence that the transition will go smoothly and you won't encounter any problems.
    For more information about the transition, read the Site Transition FAQ.
    Thank you for your support,
    The Adobe Business Catalyst Team

Maybe you are looking for

  • How to get the input values when create shpping cart(FPM_OIF_COMPONENT)?

    We want to remote other applications when create a new SC(neither ordered nor saved). We must transport the screen data which entired by users. Do you have a methord to get the screen value of SC in the FPM component FPM_OIF_COMPONENT? Thank you very

  • Match not working on iPad

    I subscribed to iTunes Match in November. It works fine on my iPhone 4GS (listening through Match as I type this) but not on my iPad 4 (iOS 6.0.1). In Settings I click on "turn on iTunes Match", a box appears with my Apple ID and asking for my passwo

  • Sort order notes iOS 6.0

    Since it is finally possible to sort my Notes with MacOS 10.8.2 I am desperately seeking for the same possibility on my iPhone and iPad (iOS 6.0). It does neither use the sort-order (alphabetically!!!) from my desktop Mac nor am I able to change the

  • Please help to find the correct answers

    Hi, Please send an url to study about the below questions with short and easily understandable explanation with simple example.Please help to improve my knowledge for the below concepts. 1.     String 2.     String Buffer 3.     String Builder 4.    

  • How to call webservices from IDM

    Hi, can anyone provide some documents how to call a web service from IDM 7.1 Thanks in Advance Regards, mary