Design to integrate new code without changing the existing code

I have a timer class which will measure the time taken for the method to execute. I want to integrate this to my present code base. basically the timer class just starts the time at the start of the method and once the method completes it subtract the final time from the start time to give me total time spent in this method. I was wondering if there's a way by which i can integrate my timer without actually changing my methods.I have to start the timer when the method is going to execute and end the timer once it has finished executing. Any design pattern you think could help me?

javanewbie80 wrote:
I was wondering if there's a way by which i can integrate my timer without actually changing my methods.I have to start the timer when the method is going to execute and end the timer once it has finished executing. Any design pattern you think could help me?Those are contradictory and exclusive.
A design pattern represents an idiom, generalized from several specific examples, of commond coding practices.
Thus if you use it is is code.
So the question has nothing to do with a design pattern.
As for the other part of the question, as suggested AOP or generally code injection.
You might note as well that there are already commercial applications and probably non-commercial as well that exist to time application run time and the method level.

Similar Messages

  • Integrate new MA without changing the existing environment

    Hi,
    Can any one please suggest me for the below scenario.
    Consider in the current environment. , we have deployed FIM sync server  and configured three management agent of type ADDS. There are some rule extension deployed for exchange and Lync. FIM Portal and MS Bhold is not installed and used. Total
    number of user are 15k.
    Now we have new requirement to integrate a new  AD and  new  Ldap management agent to provision and  provision  500 user.
    For these new 500 users, we also need FIM Portal and MS Bhold.
    We don't want to make any  change in the existing  configured MA. Can we implement like this.
    1. Install FIM Portal and MS bhold on the  existing server on which FIM syn server is already installed.
    2. Configured the new management  for new AD and Ldap.
    3. Configured the FIMMA to allow only the new 500 user to provision in FIMService based on some criteria  which can get from the new AD and Ldap.
    4. Do the required configuration of MPR,Syn rule etc in FIM Portal.
    5 .Do the configuration  export and import the user in Bhold  for only new 500 users to approval, groups management etc.
    OR
    Install the FIM Portal and Bhold and then reconfigure the all exiting management agent using  the FIM Portal GUI.
    Please suggest which is best way. If we need to reconfigure the all the existing MA using FIM Portal or just install the FIM Portal and Bhold and configure the  required MA for new 500 users only.
    Thanks
    Harry

    Thanks Dominik for your response,
    So it means there will not be any performance issue if we keeps existing MA in Synchronization server (without FIM Portal) and install the FIM portal and Bhold to manage and create new AD and LDAP MA for new 500 users using FIM Portal GUI.
    As well as per my understanding, only  500 cals  Licence will be required because only new 500 users will be managed by FIM Portal (FIMService) and MS Bhold. Cals license will not be required for rest old 15K user  because these
    will be managed by only by Synchronization server(FIMSynchronizationService ) not FIMSevice.
    Please correct me.
    Thanks
    Harry

  • HT1296 how to add new photos without deleting the existing photos in ipad

    Hi,
    Can anyone tell me how to add new photos/PDF books from my PC to iPad without deleting the exsting data in iPad?

    Hello AJ2349
    If it is prompting you that it will replace the data on your iPhone, then that is typically the result of syncing with a different computer. The only way you can bypass that is to replace the media on your device and then sync. Now it will only replace items that would be considered purchased items like music, movies, TV shows and Apps and would not delete any pictures from your iPhone. Alternatively you can setup a Shared Photo Stream and then add the Photos there without syncing your iPhone with your computer. Check out the articles below for more information.
    iOS: Issues syncing content with multiple computers using iTunes
    http://support.apple.com/kb/ts1474
    Managing content manually on iPhone, iPad, and iPod
    http://support.apple.com/kb/ht1535
    iCloud: Shared Photo Streams FAQ
    http://support.apple.com/kb/HT5903
    Regards,
    -Norm G.

  • How can I transfer a profile to my new computer without overwriting the existing profile?

    I have a new Window 7 computer and have started using TB. I now want to transfer my messages from my old (Window XP) and do not want to overwrite the data in the new computer. Is there a way to transfer the old data and add it to the new profile?

    For downloads of CS3 see THIS thread.
    For your serial number, if Photoshop is still running on your old machine;
    Start Photoshop. Goto Help > System Info. Buried in amongst all the stuff in there will be your serial number. Read through it carefully.
    If Photoshop is not installed / running on your old machine, then you are indeed pretty much hosed.
    This is always assuming software that old will run successfully on a new machine, of course.
    --OB
    Dang! Too late again!

  • How to name individual clips without changing the name of the original file...?

    Hi,
    Theres likely to be a really simple solution to this, but i can't find it! I've done my in & out points, i've created a new clip and i'd like to give it a unique name. When i rename the clip the original file name also changes. How can i rename the new clip without changing the original file name?
    Please help,
    Thanks
    Ed

    Either make the clip a subclip or convert it to a new master clip. Both can be done in the Modify menu.

  • Can I update my phone without changing the interface/design?

    I haven't updated my iPhone 4S in ages - I think I may still be using IOS 4 or IOS 5. I love the old interface, and I really, really don't want to have to change to the new interface (I've seen it and it looks completely different). I'm very fond of how safari works, how pass code locking works, how photo albums are designed, the proccess of clearing apps - everything. The problem is that there are a few apps I'd like to download that require IOS 6 or above. My question now is either,
    1) is it possible to update your phone without changing the design/interface
    2) is it possible to download IOS 6 or 7 apps on an earlier version phone without updating the entire phone
    Thanks so much

    1. No.
    2. No.

  • How to edit the cube with new fields without changing historical  in BI 7.0

    HI,
    I have requirment that need to edit cube with new fields and without changing historical data on it.
    Please some one can advise me abt the above scenario.
    Note:I am using BI7.0

    hi Krish,
    In BI 7.0,
    we cannot add a characteristic to an existing dimension if the data is not deleted from the cube.
    It can go to a new dimension and that will not change the existing structure of the cube tables, but will just add to it (as another dim table).  or use remodeling.
    for more details, please seach threads.....
    with hopes
    ARS

  • Can v define a new absence type without changing the grouping.

    Dear friends,
          can we define a new absence type without changing the employee subgroup grouping and psg.
    my requirement is i have a absence type lop which has 1 as esg and 28 as psg.as per my pcr i have to cumulate total lop hours and deduct from total working hours.
    can any one tell me how can i modify the absence type so that i can use it in my pcr.
    Regards,
    sai prasad

    Dear sreenu,
        if i create a time type.can i refer in this
    following pcr
    5200
    ADDWT *       NUM=GSAP**
    ADDWT 5310
    if yes, can you plz tell me how can i do it

  • How can I keep my audio track, delete a short segment of video, and reinsert a new video clip, without changing the audio with the way it lines up with the original video?

    How can I keep my audio track, delete a short segment of video, and reinsert a new video clip, without changing the audio with the way it lines up with the original video?

    If you have either iMovie 09 or iMovie 11 you can do this easily using the Cutaway feature.
    Go to iMovie/Preferences and make sure that the Advanced Tools are enabled.
    Now you jut drag and drop the 2nd clip onto hte first clip at the frame where you want the Cutaway to start. A popup menu will appear. Choose Cutaway.
    Here is a good Tutorial.
    If you have iMovie 08, let me know. There is a way to do it, but it is more complex.

  • Customize interface without touching the source code

    My VP of of marketing is at it again. I have pasted in the exact email that he sent me. If anyone has ideas or suggestions or knows if Forms 9i has this built-in capability, please let me know.
    Thanks.
    Can you post this on metalink and see if someone at Oracle (or elsewhere) has an answer for us? Somehow, other LIMS developers are distributing LIMS products that allow their users to customize the interface without touching the source code -- no impact on their ability to take new releases. How do they do that?
    Here's my question:
    Anyone familiar with the Tools / Forms / Design this Form feature in MS Outlook? This allows a mere mortal to actually create and publish a custom Outlook form (could be a Contact, Task, Note, Journal, etc. form) across the organization. Is there such a capability built into Oracle9i Forms? In other words, can a developer easily build and distribute an Oracle software app such that the end-user can use an administrative tool to modify the interface/forms, add fields, change field names, move things around on the form, change colors, etc. -- without needing the Oracle Developer tool used by the original software developer, along with source code?
    Here's my original email from a few months ago:
    Our VP of marketing has been on my case about the ability to allow customers to "map" a form label (prompt) to a "custom" label of their choosing. The only way I know to do this is to create a "mapping" table and each time a form opens have code in the Post-Query trigger that changes the prompt of each column to the label that is in the "mapper" table. My fear here is Performance. Also, if the user closes that form and comes back to it - that logic has to be executed again - once again Performance. We have thought about the global variable idea, but we have over 100 tables with approx. 20 columns each. That's alot of globals to carry around. What's the overhead of carring around let's say 150 global variables?
    My questions to all of you are:
    1) Is anyone else doing this exact thing?
    2) If so, what is the performance hit?
    3) Is there a way to "remember" after the first time it paints - until the application is closed (not just that form) - other than global variables?
    4) Is there a solution already in place within Forms for this?
    5) Is there newer technology that has overcome this problem?
    My VP doesn't like the mapping idea. He wants to know isn't there a better way instead of mapping all the fields. Isn't there some simple utility provided by Oracle that allows the user to simply change the form labels (no, he's not talking about Oracle Developer). He is a real Outlook nut. So he's always comparing everything to how Outlook works. This is how it works in Outlook -- you click on Design Form, modify it, then install it on the machine. Surely Oracle must have something like this. He thinks we're asking the wrong question or not asking it in the right way. I'm not sure how else to ask it. Our users want to see "Date of Birth" spelled out instead of "DOB" as the label for a column on a form. Is there a way for them to take the fmx and change that label? Is there a better way other than storing this in a table and querying it up each time the form opens? Yes, I could use a global so I don't have to query it from the database every time, but I still have to evaluate every time the form is opened during that session to see which label I need to use and then set the prompt accordingly. Our VP doesn't like this, he wants this to be a one time change.
    Thanks so much for you help,
    Tina

    Hmmm.... either your VP of marketing or the users have too much time on their hands. ;-)
    I would go with a lookup table. If your database is responsive and you index the table by form name, you can retrieve a number of rows and setup the screen quickly enough that nobody would notice any time lag.
    If there aren't too many titles stored in the form, you could use a PLL library procedure and stuff all of them into a few globals -- just stack them into a single string separated by an odd character, like maybe chr(3). Then when the form is called again, it could first check to see if the globals exist, and parse the titles from there.
    But be careful about changing field titles. If they change DOB to Date of Birth, the length changes, and so you need to determine where the extra length goes. The title field must be wide enough and the text justification should be set properly.

  • How do I change the Version Code in the Flash Android settings Android app market?

    I recently tried to update my app in the Android app market and when I uploaded it I got the following message:
    "The new apk's versionCode (1000000) already exists."
    In the Flash Adnroid settings I changed the version label but that did not help.
    So I have two questions:
    How do I change the Version code in the Flash Android settings? I changed the version number and version label but that did not work.
    What is the difference between the version number and version label?

    I tried that but it did not work. Apparently there is a difference between the version code and version number (which is set in the Android settings). From my research the version label is optional, so there are no problems there.
    This is the what the XML file says:
    <?xml version="1.0" encoding="UTF-8" standalone="no" ?>
    <application xmlns="http://ns.adobe.com/air/application/2.6">
      <id>com.company.nameofapp</id>
    //Below is the correct version number, but has no relation to the version code.
      <versionNumber>1.1.0</versionNumber>
      <versionLabel>NewLayout</versionLabel>
      <filename>Name of app</filename>
      <description/>
    I did find this piece of information for Androin version codes. (http://developer.android.com/guide/publishing/versioning.html)  But I don't know how to place it into the xml file without conflicting with other code.
    <?xml version="1.0" encoding="utf-8"?>
    <manifest xmlns:android="http://schemas.android.com/apk/res/android"
          package="com.example.package.name"
          android:versionCode="2"
          android:versionName="1.1">
        <application android:icon="@drawable/icon" android:label="@string/app_name">
        </application>
    </manifest>
    Any other thoughts are much appreciated.

  • How do I change the Version Code in the Flash Android settings for the Android app Market?

    I recently tried to update my app in the Android app market and when I uploaded it I got the following message:
    "The new apk's versionCode (1000000) already exists."
    In the Flash Adnroid settings I changed the version label but that did not help.
    So I have two questions:
    How do I change the Version code in the Flash Android settings? I changed the version number and version label but that did not work.
    What is the difference between the version number and version label?

    I tried that but it did not work. Apparently there is a difference between the version code and version number (which is set in the Android settings). From my research the version label is optional, so there are no problems there.
    This is the what the XML file says:
    <?xml version="1.0" encoding="UTF-8" standalone="no" ?>
    <application xmlns="http://ns.adobe.com/air/application/2.6">
      <id>com.company.nameofapp</id>
    //Below is the correct version number, but has no relation to the version code.
      <versionNumber>1.1.0</versionNumber>
      <versionLabel>NewLayout</versionLabel>
      <filename>Name of app</filename>
      <description/>
    I did find this piece of information for Androin version codes. (http://developer.android.com/guide/publishing/versioning.html)  But I don't know how to place it into the xml file without conflicting with other code.
    <?xml version="1.0" encoding="utf-8"?>
    <manifest xmlns:android="http://schemas.android.com/apk/res/android"
          package="com.example.package.name"
          android:versionCode="2"
          android:versionName="1.1">
        <application android:icon="@drawable/icon" android:label="@string/app_name">
        </application>
    </manifest>
    Any other thoughts are much appreciated.

  • Can I alter the properties of an individual link on a HTML page without changing the other links?

    Hi there,
    I have a contact page created in Dreamweaver and have created an email link to launch Outlook when clicked on. However, all the links in my design have been set a certain way, i.e. white text knocked out of darker background. My email link however, is on white background so you can't see it against the white. I want to go in and simply change the color property of the email link without changing the other link colours on the page. I've tried but without luck. Is this possible to do?
    Thanks in advance for any help!

    Hello and thank you for your answer. I'm still a little confuse though.
    My existing HTML looks like this:
    <p><a href="[email protected]">[email protected]</a><br />
    My link preferences are for the who page and are at the top and look like this:
    a:link {
        color: #FFFFFF;
        text-decoration: none;
    a:visited {
        text-decoration: none;
        color: #FFFFFF;
    a:hover {
        text-decoration: none;
        color: #CCCCCC;
    a:active {
        text-decoration: none;
        color: #CCCCCC;
    .style2 {font-size: 14.5px}
    .style3 {color: #FFFFFF}
    Where exactly should I insert the new link ID that you suggested <a id="special_colors" href="url...">link text</a>
    Also, where exactly should I place the following in relation to the CSS document
    a#special_colors:link {color: red;}
    > a#special_colors:hover {color: green;}
    Sorry but this is all quite new to me. Thank you for your patience and help.

  • Urgent:How to modify a script without changing the print programme

    Hi all,
    Can any body pls tell me <b>How to modify a script without changing the print programme</b>
    Give m esome real time examples.
    Good points willbe rewarded
    Thanks

    Hi
    You can write a external Subroutine to fetch the extra data into the script program
    see the following sample code
    How to call a subroutine form SAPscripts
    The Form :
    /:PERFORM CDE_CENT IN PROGRAM ZKRPMM_PERFORM_Z1MEDRUCK
    /:USING &EKKO-EBELN&
    /:CHANGING &CDECENT&
    /:ENDPERFORM
    The report :
    REPORT zkrpmm_perform_z1medruck .
    DATA : BEGIN OF it_input_table OCCURS 10.
    INCLUDE STRUCTURE itcsy.
    DATA : END OF it_input_table.
    déclaration de la table output_table contenant les
    variables exportées
    DATA : BEGIN OF it_output_table OCCURS 0.
    INCLUDE STRUCTURE itcsy.
    DATA : END OF it_output_table.
    DATA : w_ebeln LIKE ekko-ebeln,
    w_vbeln LIKE vbak-vbeln,
    w_zcdffa LIKE vbak-zcdffa.
    FORM CDE_CENT
    FORM cde_cent TABLES input output.
    it_input_table[] = input[].
    it_output_table[] = output[].
    READ TABLE it_input_table INDEX 1.
    MOVE it_input_table-value TO w_ebeln.
    CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
    EXPORTING
    input = w_ebeln
    IMPORTING
    output = w_ebeln.
    SELECT SINGLE zcdffa FROM ekko
    INTO w_zcdffa
    WHERE ebeln = w_ebeln.
    it_output_table-name = 'CDECENT'.
    MOVE w_zcdffa TO it_output_table-value.
    MODIFY it_output_table INDEX 1.
    output[] = it_output_table[].
    ENDFORM.
    COPING SCRIPT
    There are some Standard Sap Scripts in SAP. We cant directly execute them in scripts we have to use some T-codes and by giving some input to the required fields we can see the output printform.
    I will show one example. There are some Standard Sap Scripts such as MEDRUCK which is a standard Sap Script for Purchase Order and RVINVOICE01 for billing and so on...
    To see oupt of MEDRUCK go to T-code ME9F give purchase order number and execute select one number and click on dislplay messages button on application tool bar you can find the print form of MEDRUCK.
    You cannot change the Standard Sap Scripts but you can use Standard Sap Scripts and Copy them to userdefined Script and can make changes to them and replace standard Sap Script with usedefind script.
    Ex: Go to SE71,
    on menu bar u find Utilities->copy from Client. click on it u ll find new screen showing
    Form name:
    Source Clinet:
    Target Form:
    give Form name as usedefined form name EX: ZFORM1
    Source client as 000 and
    Target form as MEDRUCK.
    execute.
    Now, the standard from MEDRUCK is copyied to your form ZFORM1.
    NOW, go to SE71 and give form name as ZFORM1 and do some changes to the form such as adding logo any thing. save and Activate.
    Now, you have done changes to the Form ZFORM1 and u have to replace your form with standard SAP Script.
    Go to NACE Transaction.
    on Applications select EF for purchase order and click Output types button on application tool bar.
    now select NEU as output types dobule click on Processing Routines.
    now click on Change option on application tool bar and on right side u find MEDRUCK in form place replace MEDRUCK with ZFORM1 and SAVE.
    go back twice and now go to T-code ME9F give the purchase order number and execute and select one option and click on display messges button .
    you will find the changes that you have done in ZFORM1. so we cant chage the standard Sap Scripts by copying the Standard Sap Scripts we can chage and replace with our forms
    Refer
    https://forums.sdn.sap.com/click.jspa?searchID=4089895&messageID=3239299
    Regards
    Message was edited by:
            Kiran Sure(skk)

  • Change sapscript without changing the driver program

    Hi! Abapers
    is there any way out to modify sapscript for the transaction code ME22N without changing the driver program.
    thankx
    Amit
    TCL

    Hi,
    Yes you can change the form to your needs and use the text elements available in print program and if any thing which you are needed is not available write performs in your script itself and try to fetch your data. configure your new form in nace transaction.
    Thats it..
    Reward if find useful

Maybe you are looking for