Best Practice: Sharing Action Task

My application has two Action implementations. One is "SaveAs" which shows a JFileChooser and then saves to file using SwingWorker to keep GUI responsive. The other is "Exit" which does exactly the same (but only if the lokal document is "dirty") and terminates the application after that. It works pretty well.
But it is not nice that 90% of the code is duplicated, so the question is, what is the best practice?
One could imagine a lot of possible solutions, like:
- Exit extends SaveAs, or both extending a common super class. Technically right, but rather strange: What shall that super class be named besides a synthetical "ExitAndSaveAsSuperClass"...?
- Exit calls SaveAs and passes a parameter telling SaveAs to exit after SwingWorker is finished. Technically possible, but horizontal calls always have a bad smell of SpaghettiCode.
- Exit and SaveAs both have no own code besides telling a third class to do the work. Looks like a good separation of Action and Task. But looks like breaking a butterfly on a wheel.
- etc.
So what I like to know is not whether anybody has any more ideas or what anybody thinks about the above ideas. My question actually is whether there has been emerged a "best practice" for this problem (sharing of Action Task)? I mean, Swing is around for decades now so I assume that there are lots of best practices existing, but I just did not found them so far on the web...?

Perhaps refactor the common save-as functionality in a method of the class, and have the two listeners both use it.

Similar Messages

  • Best practice for upgrading task definition without deleting task instances

    best practice for upgrading task definition in production system without deleting or terminating task instances
    If I try and update a task definition with task instances running I get the following error:
    Task definition 'My Task - Add User' may not be modified while there are active task instances
    Is there a best practice to handle this. I tried to force an update through the console but that didn't work. I tried editing the task from the debug page and got the same error.

    1) Rename the original task definition.
    2) Upload the new task definition with the original name.
    3) Later, after all the running tasks have timed out, delete the old definition.
    E.g., if your task definition is "myWorkflow":
    1) Rename "myWorkflow" to "myWorkflow-old-2009-07-28"
    2) Upload the new task definition as "myWorkflow".
    Existing tasks will stay linked to the original (renamed) workflow definition.
    New tasks will use the new definition.
    As the previous poster notes, depending on the changes you are making, letting the old task definitions stay active could have bad side-effects and might be better avoided.

  • Best practice for upgrading task definition in production system

    If I try and update a task definition with task instances running I get the following error:
    Task definition 'My Task - Add User' may not be modified while there are active task instances
    Is there a best practice to handle this. I tried to force an update through the console but that didn't work. I tried editing the task from the debug page and got the same error.

    The best way for upgrade purposes is to use the rename function of the TaskDefinition from the lh command line utility.
    Basically renames all current task instances with the TaskDefinition name. You can then alter the existing TaskDefinition and upload into identity manager.

  • Outlook Calendar 2013/ Office 365 - Best Practice Sharing an Outlook Calendar with others

    I am being asked to share user calendars with several users. Would anyone have a recommendation or know the best practice on doing this? I know of two options.  Normally I would have used the option in Outlook to add delegates. I was working on
    another issue and someone showed me how you can right click on the users name in Calendar and choose properties and then click the permissions tab. The second option changes permissions just for Calendar. Using the delegate option, inbox permissions
    can be granted also. Is one of these options better than the other?  Thanks

    Hi,
    There are a few differences between Sharing and Delegation in Outlook. The most important thing is that delegates are people who are allowed to send on behalf of you while sharing is just that you share your folders with others.
    There is a general setting in the main Delegates dialog to control whether or not you will still receive these messages yourself as well.
    In addition, you can also control whether or not a delegate will receive these messages on a per-delegate basis. This cannot be done by just sharing your Calendar.
    Besides, delegate permissions are also required when you want to grant your colleague the permission to see items which are marked as Private. However, there is no way to grant this permission on a per-folder basis.
    For more information about this, you can have a look at this:
    http://www.msoutlook.info/question/857
    Best Regards,
    Steve Fan
    TechNet Community Support
    It's recommended to download and install
    Configuration Analyzer Tool (OffCAT), which is developed by Microsoft Support teams. Once the tool is installed, you can run it at any time to scan for hundreds of known issues in Office
    programs.

  • Business Transaction Management (BTM) Best Practices Sharing

    A client I am working with is interested in building relationships with other Oracle customers using Business Transaction Management (BTM). The goal is to share tips, tricks, and best practices. BTM came from Oracle's acquisition of AmberPoint. Please contact me if you are interested in engaging. I can be reached at [email protected]

    Unless there is some other reason, users should own the right to share their mailboxes - it shouldn't be something that demands administrator management (if only so that the administrators aren't swamped by user requests for sharing their mailboxes). 
    For true shared mailboxes, when the mailbox is created, full access is granted by an administrator.

  • Best Practice Question Re: Tasks That Actually Finished before Predecessors in a Baselined Schedule

    Hindsight is indeed 20/20, but here is the situation:
    Set of Tasks A (Design IDD Tasks) - These tasks are not complete and are, in fact delayed
    Set of Tasks B (ARC Tasks) – In the baseline, they have Set of Tasks A as their immediate predecessors – some are marked as complete and I made those updates
    Set of Tasks C (Tasks that Depend on ARC Tasks) – in the baseline they have Set of Tasks B as their immediate predecessors
    The Problem is delays to Set of Tasks A currently do not affect Set of Tasks C (Tasks that Depend on ARC Tasks) – and they should. I am looking for the best way to make Set of Tasks C reflect delays from Set of Tasks A, given that the project has been
    baselined with a certain set of predecessors and successors.

    Leslie - If you are looking for videos, you can try this. I delivered ten webinars on Microsoft Project 2010 last year and its recordings can be played for
    free. 
    Session 1: Ready. Set. Go. Preparing Project :
    http://goo.gl/yWVGn
    Session
    2 : How to change working time and set holidays in Project 2010?
    http://goo.gl/QTRds  
    Session 3 : Structure the schedule by WBS and task
    dependencies http://goo.gl/SPqkM  
    Session 4 : Setup people, cost and material resources
    in Project 2010 http://goo.gl/lBTUF  
    Session 5 : Assigning resources (people and material)
    and costs (fixed,variable) http://goo.gl/PPI18  
    Session 6 : Convert draft schedule to optimal schedule
    that meets stakeholders requirements http://goo.gl/ptdTl  
    Session 7: Keeping Your Project on Track by Leveraging
    the Baseline Features of Project 2010 http://goo.gl/TM8Gv   
    Session 8: Track project actual against project baseline
    information http://goo.gl/ZWJxP  
    Session 9 : Report project performance through Reporting
    Features http://goo.gl/CC76e  
    Session 10: Sharing Resources across Projects
    http://goo.gl/JkZU01
    Sai PMI-SP, MCTS Project, MVP Project

  • Best practice for action that needs to execute after a successfull login

    hi all;
    i am looking for a good approach for dealing with the following scenario:
    i have a jsf command link with an action - everyone have access to this page.
    when the user clicks the command, the next page is a realm protected resource, so the login page kicks in and only if there is a succesfull login, i want some logic to be executed.
    my problem is that i cant find a good place to put that logic. i can alway point to a bean from the protected page and put the logic in the bean's constructor but this feels kind of wierd.
    any suggestions?
    thanks in advance.

    Since I had to stop execution based on condition, And thus the TimerTask.cancel() method.

  • Any best practices sharing iPhoto library between iMac and MacBook Pro

    I have my iPhoto library on my iMac, but I would also like to view and edit keywords, etc on my MacBook Pro.
    Any suggestions on how to do this?

    Larry
    There are two ways to share, depending on what you mean by 'share'.
    If you want the other user to be able to see the pics, but not add to, change or alter your library, then enable Sharing in your iPhoto (Preferences -> Sharing), leave iPhoto running. On the other machine enable 'Look For Shared Libraries'. Your Library will appear in the other source pane.
    Remember iPhoto must be running on both machies for this to work.
    If you want the other user to have the same access to the library as you: to be able to add, edit, organise, keyword etc. then:
    Quit iPhoto ion both machines.
    Move the iPhoto Library Folder to an external HD set to ignore permissions
    On each machine in turn: Hold down the option (or alt) key and launch iPhoto. From the resulting dialogue, select 'Choose Library' and navigate to the new library location. From that point on, this will be the default library location. Both machines will have full access to the library, in fact, both accounts will 'own' it.
    However, there is a catch with this system and it is a significant one. iPhoto is not a multi-user app., it does not have the code to negotiate two users simultaneously writing to the database, and trying will cause db corruption. So only one user at a time, and back up, back up back up.
    Regards
    TD

  • Best practice tast profile security in BPC

    Hi,
    I'm in the middle of a BPC NW 7.5 implementation project and need to set up the task profiles in BPC. I'm looking for a clear description of the different tasks - does anyone now if this is available?
    Furthermore I'm interested in Best Practice experiences with task security in BPC - any input on this matter?
    Thanks,
    Lars

    Hi,
    You can extract the information from the Security Guide located on Service MarketPlace at:
    https://websmp202.sap-ag.de/securityguide
    follow the path to "SAP BusinessObjects (formerly, SAP Business User)" and select
    SAP BPC 7.0, version for SAP NetWeaver Security Guide
    hope it helps...
    regards,
    Raju

  • Best Practices for Configuration Manager

    What all links/ documents are available that summarize the best practices for Configuration Manager?
    Applications and Packages
    Software Updates
    Operating System Deployment
    Hardware/Software Inventory

    Hi,
    I think this may help you
    system center 2012 configuration manager best practices
    SCCM 2012 task-sequence best practices
    SCCM 2012 best practices for deploying application
    Configuration Manager 2012 Implementation and Administration
    Regards, Ibrahim Hamdy

  • Best Practices for sharing media with iMovie and FCPX

    So I've a large iMovie Events directory, and would like to use that media with both iMovie and FCPX projects.
    I'd rather not duplicate the media, so would prefer to import as references into FCPX.
    The dilemma is that I see that it's possible to modify or move media from within the iMovie application, and therefore break the reference to that media with FCPX.
    I only see two options:  (1) Never Ever modify the location/name of media in the iMovie Events file (even from within the iMovie app) since I would break an FCPX link if that media is referenced, or (2) always import (copy) the iMovie events into the FCPX Event Library making an independent original so that I can confidently operate on those media files in either application.
    I'd surely rather not have to do (2 )(e.g. doubling my storage demands) to gain the flexibility of using either application to edit the video, but really don't want to live with the restrictions of (1).
    Thoughts / Solutions?  What might you consider as options or best practices?

    Unless there is some other reason, users should own the right to share their mailboxes - it shouldn't be something that demands administrator management (if only so that the administrators aren't swamped by user requests for sharing their mailboxes). 
    For true shared mailboxes, when the mailbox is created, full access is granted by an administrator.

  • Best practices for office 365 SHARED CALENDAR for whole school / organization

    hi
    we need guidance on best practice for setting up SHARED CALENDAR on Office365 exchange server for entire organization (school)of150 staff.
    Requirements
    + all staff should have read only / reviewer permissions on calendar
    +handful staff should have editor permissions on calendar
    + the calendar should synchronise custom categories and colors
    Current Solution
    at the moment we have found that a shared mailbox is the best solution because;
    - allusers can add the shared mailbox on outlook 2010as additional mailbox as readonly
    - all the categories & colors for the calendarare automatically synchronised because the color categories are stored within this mailbox.
    - you can edit calendar permissions in outlook to allow some users as "editor" of the calendar.Problem with Current Solution
    the problem however is that the users also need to access this...
    This topic first appeared in the Spiceworks Community

    Hi Aleksei,
    I think Inactive mailboxes in Exchange Online is the feature that you want. This feature makes it possible for you to preserve (store and archive) the contents of deleted mailboxes indefinitely.
    A mailbox becomes inactive when an In-Place Hold or a
    Litigation Hold is placed on the mailbox before the corresponding Office 365 user account is deleted.
    But I'm afraid that it might be impossible to "easily share certain folders or even whole mailbox with people in the company". As can been seen from below articles, this only allows administrators, compliance officers, or records managers
    to use the In-Place eDiscovery feature in Exchange Online to access and search the contents of an inactive mailbox:
    http://technet.microsoft.com/en-us/library/dn144876(v=exchg.150).aspx
    http://blogs.technet.com/b/exchange/archive/2013/03/21/preserve-mailbox-data-for-ediscovery-using-inactive-mailboxes-in-exchange-online.aspx
    Anyway, this is the forum to discuss questions and feedback for Microsoft Office client. For more details about your question, I would suggest you post in the dedicated forum of
    Exchange Online, where you can get more experienced responses:
    https://social.technet.microsoft.com/Forums/msonline/en-US/home?forum=onlineservicesexchange
    The reason why we recommend posting appropriately is you will get the most qualified pool of respondents, and other partners who read the forums regularly can either share their knowledge or learn from your interaction with us. Thank you for your understanding.
    Regards,
    Ethan Hua
    TechNet Community Support
    It's recommended to download and install
    Configuration Analyzer Tool (OffCAT), which is developed by Microsoft Support teams. Once the tool is installed, you can run it at any time to scan for hundreds of known issues in Office
    programs.

  • Best Practice for External Libraries Shared Libraries and Web Dynrpo

    Two blogs have been written on sharing libraries with Web Dynpro DC, but I would
    like to know the best practice for doing this.
    External libraries seem to work great at compile time, but when deploying there is often an error related to the external library not being a deployed component. 
    Is there a workaround for this besides creating a shared J2EE library which I have been able to get working?  I am not interested in something that works, but really
    what are the best practice for this. What is the best way to  limit the number of jars that need to be kept in a shared library/ext library.  When is sharing ref service/etc a valid approach vs. hunting down the jars in the portal libraries etc and storing in an external library.

    Security is mainly about mitigation rather than 100% secure, "We have unknown unknowns". The component needs to talk to SQL Server. You could continue to use http to talk to SQL Server, perhaps even get SOAP Transactions working but personally
    I'd have more worries about using such a 'less trodden' path since that is exactly the areas where more security problems are discovered. I don't know about your specific design issues so there might be even more ways to mitigate the risk but in general you're
    using a DMZ as a decent way to mitigate risk. I would recommend asking your security team what they'd deem acceptable.
    http://pauliom.wordpress.com

  • Best Practice - Bounded Task Flows, Regions and Nested Application Modules

    Using JDev 11.1.1.3; understand that it's generally considered good practice to just have 1 root application module servicing model content / services for each page. In our application, we've used a number of bounded task flows and page fragments deployed as af:region's into pages as either a) views targeted in page-flow navigation, b) tab panel content inside a regular jspx, or c) af:popup / af:dialog content. As it stands, we've not engaged nesting of the application modules for this embedded region content, so these regions are no doubt instantiating new AM's if/when invoked. Should the AM's servicing these embedded regions be deployed nested within the root AM's, and then if so, does this change the way that the jsff / fragment content is actually developed (currently as per any other jspx using the DataControl pallete). Or are the best-practice directives talking about a page as being the design-time / declarative composition of content rather than the run-time aggregation of page + fragments ... in which case the fact that our embedded fragments are not using nested AM's is unlikely to concern.
    Thanks,

    Probably a better question for the ADF EMG: http://groups.google.com/group/adf-methodology?hl=en
    CM.

  • What is the best practice to display info of completed task in process flow

    Hi all,
    I'm starting to study BPM modeling with CE7.1 EHP1. Thanks to the tutorial and example on SDN site and I can easily build my own process in NWDS and deploy to server, start it, finish it.
    I like the new runtime which can show a BPMN diagram to the processors. However, I can't find a way to let the follow up processor to review the task result completed in previous step. I'm more familiar with Guided Procedure, and know there is "Display Callable Object" which can used to show some info of a completed task when the processor/owner/admin/overseer click on a completed task.  Where is the feature in BPM ? What is the best practice to show such task information in BPM environment.
    For example, A multiple level approval process, the higher level approver need to know the comment written by the previous approver. Can he read this information from process flow ?
    I think it is very important feature for a BPM platform. In Guided Procedure, such requirement can be done with Display Callable Object + View Permission, and you just need some coding for the UI. If BPM is superior to GP, I think there must be a way to achieve this, I just do not know how ?
    Can anyone shed me some light on it ?

    Oliver,
    Thanks for your quick reply.
    Yes, Notes and Attachment CAN BE USED for the purpose. But I'm still looking for a more elegant solution.
    With the solution of using Notes/Attachment, the processor need to give input at two places : the task UI and Note/Attach , with similar or same data. It is really annoying.
    Is there any SAP BPM real-world deployment ? None of customer has the requirement ?

Maybe you are looking for

  • Can i move a boot volume (to a partition on another HD)?

    i have a boot install of windows xp and windows 7 on two separate HD's in my mac pro and i would like to consolidate these (along with my primary mac OS) onto one single drive. can i migrate these somehow to a new partitioned drive? TIA

  • Identifying the maximum length of a record in internal table

    Hi, Im using an internal table for a string for some requirement. Now, at later point of time i need to use for CHAR variable to copy the data from the above internal table. I need to identify the max length of the record stored in this internal tabl

  • Webpage not working everywhere

    My published webpage works on my Mac and my PC. It works on Safari, and on Firefox. It looks strange and too light on Internet explorer, and some people have told me that it is so light on their computers that they cannot see much at all; neither can

  • Arch Linux

    I've been a linux user for about 7 years and I must say this is the best distro i've used thus far. I decided to switch from gentoo after getting tired of compiling everything and their nasty layout of /etc. I had arch up and running in about 10 minu

  • Oracle 8i Enterprise on Pentium IV machine

    When I tried to install Oracle 8i Enterprise on a Pentium IV machine with the Windows NT OS having 256MB memory (RIMM), It simply does not work. When I clicked the Installation icon, the hourglass appears for couple of seconds and then stops as if I