Timeline code to document class code - best practices

I'm starting to put all of my code in the document class instead of on the main timeline, and I have a few questions. When I was using the timeline, everything was linear. It was easy to know when things would start and end because of how the playhead moves. With the document class, I noticed for the first time that functions are executed simultaneously if you call them one after the other. What would be the best way to make them execute in sequence? Let's say I have functions f1, f2, and f3. I suppose at the end of f1 I could call f2, and at the end of f2 call f3, or use event listeners, but is that the right way to do it? By the time you get to f3, aren't f1 and f2 still "open" because they haven't terminated?

do you want some appreciable time to transpire between executing f1,f2 and f3?
if yes, use a timer or timers.  if no, then just call them sequentially. with few exceptions (mainly when loading some external (to flash) file executes code synchronously:
f1();
f2();
f3();

Similar Messages

  • Where to put java code - Best Practice

    Hello. I am working with the Jdeveloper 11.2.2. I am trying to figure out the best practice for where to put code. After reviewing http://docs.oracle.com/cd/E26098_01/web.1112/e16182.pdf it seemed like the application module was the preferred spot (although many of the examples in the pdf are in main methods). After coding a while though, I noticed that there were quite a few libraries imported, and wondered whether this would impact performance.
    I reviewed postings on the forum, especially Re: Access service method (client interface) programmatically . This link mentions accessing code from a backing bean -- and the gist of the recommendations seems to be to use the data control to drag it to the JSF, or use the bindings to access code.
    My interest lies in where to put java code in the first place; In the View Object, Entity Object, and Am object, backing bean.....other?
    I can outline several best guesses about where to put code and the pros and cons:
    1. In the application module
    Pros: Centralized location for code makes development and support more simple as there are not multiple access points. Much like a data control centralizes services, the application module can act as a conduit for different pieces of code you have in objects in your model.
    Cons: Everything in one place means the application module becomes bloated. I am not sure how memory works in java -- if the app module has tons of different libraries are they all called when even a simple query re-execute method is called? Memory hog?
    2. Write code in the objects it affects. If you are writing code that accesses a view object, write it in a view object. Then make it visible to the client.
    pros: The code is accessed via fewer conduits (for example, I would expect that if you call the application module from a JSF backing bean, then the application module calls the view object, you have three different pieces of code --
    conts: The code gets spread out, harder to locate etc.
    I would greatly appreciate your thoughts on the matter.
    Regards,
    Stuart
    Edited by: Stuart Fleming on May 20, 2012 5:25 AM
    Edited by: Stuart Fleming on May 20, 2012 5:27 AM

    First point here is when you say "where to put the java code" and you're referring to ADF BC, the point is you put "business logic java code" in the ADF Business Components. It's fine of course to have Java code in the ViewController layer that deals with the UI layer. Just don't put business logic in the UI layer, and don't put UI logic in the model layer. In your 2 examples you seem to be considering the ADF BC layer only, so I'll assume you mean business logic java code only.
    Meanwhile I'm not keen on the term best practice as people follow best practices without thinking, typically best practices come with conditions and people forget to apply them. Luckily you're not doing that here as you've thought through the pros and cons of each (nice work).
    Anyway, back on topic and off my soap box, as for where to put your code, my thoughts:
    1) If you only have 1 or 2 methods put it in the AppModuleImpl
    2) If you have hundreds of methods, or there's a chance #1 above will morph into #2, split the code up between the AppModuleImpl, ViewImpl and ViewRowImpls. Why? Because your AM will become overloaded with hundreds of methods making it unreadable. Instead put the code where it should logically go. Methods that work on a specific VO row go into the associated ViewRowImpl, methods that work across rows in a VO go into the ViewImpl, and methods that work across VOs in the associated AppModuleImpl.
    To be honest which you ever option you choose, one thing I do recommend as a best practice is be consistent and document the standard so your other programmers know.
    Btw there isn't an issue about loading lots of libraries/imports into a class, it has no runtime cost. However if your methods require lots of class variables, then yes this will have a memory cost.
    On a side note if you're interested in more ideas around how to build ADF apps correctly think about joining the "ADF EMG", a free online forum which discusses ADF architecture, best practices (cough), deployment architectures and more.
    Regards,
    CM.

  • ICloud document library organization best practices?

    While I think the iCloud document library could work pretty well if I was iOS-only, I'm still having some trouble organizing something that works with my work and personal Macs as well. A big gap is lack of an iOS version of Preview.
    But more importantly, I still keep documents organized by project, and I have a lot of project folders because, well, I have a lot of work! I'm not sure how to best reconcile that with the limitations imposed by iCloud Documents. And I'm not sure how/if Mavericks tags will really help.
    The best example I've seen of a best practice to organizing iCloud documents was in this blog post from the makers of iA Writer:
    http://ia.net/blog/mountain-lions-new-file-system/
    Their folder structure mirrored their workflow rather than projects, which I think could be interesting. They haven't updated it since Mavericks, and I'm curious how they might add tags. Perhaps tags would be used for projects?
    Right now, I tend to just keep documents in iCloud that I'm actively working on, since I might need to edit it at home or on my iPad. Once they're complete, I move them to the respective project folder on the Mac. Dropbox keeps the project folders in sync, which makes iCloud Documents feel redundant.
    This workflow still feels klugy to me.
    Basically, I'm asking, have you effectively incorporated iCloud Documents into your Mac workflow? What are your best practice recommendations?
    Thanks.
    Paul

    >
    Madhu_1980 wrote:
    > Hi,
    >
    >
    > As per the doc "Best Practices for Naming Conventions" https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/90b213c2-d311-2a10-89bf-956dbb63aa7f
    >
    > In this doc, we see there are no prefixes or suffixes like DT_ for data types, MT_ for Message types, SI_ for service interfaces OM_ for operation mappings (MM_ in message mappings in earlier versions).
    >
    > but i have seen some people maintain these kind of conventions.
    >
    > For larger projects, what is the best option,
    > A) to strictly follow the instructions in the above document and not to maintain the object type prefixes or suffixes.
    > B) or to have this kind of prefixes in addition to what mentioned in the naming conventions doc.
    >
    > which is preferable, from point of long term maintainance.
    >
    > i would appreciate an opinion/guideline from people who had worked on multiple projects.
    >
    > thanks,
    > madhu.
    I have seen projects where they are specific to having DT_, MT_ prefixes and also projects which dont use them.
    Even though you dont have a DT_ or MT_ prefix for DT and MT, it would be essential to have AA, OA, OS, IS etc defining a message or service interface that will give you an idea of the mode and direction of the interface.
    On a generic term, i strongly feel that the naming conventions suggested by the document is quite enough to accommodate a large number of projects unless something very specific pops up.

  • FI document Excel upload best practice?

    Hello,
    What's the current best practice for financial document upload from Excel? (uploading data from excel to run FB01/FB50)
    Especially I'm looking for a comprehensive and easy-to-implement solution for error handling. The simulation/testrun in foreground should find out all master data and combination mistakes and give detail feedback for the user. Additionally the production run should be straight forward, also with status/error handling (read, user should not be asked to go to SM35).
    Is there any how-to docs released by SAP?
    Thanks!
    Aki

    Hi Aki
    www.mkpg.ch developed an Excel add-in called xls2Sap. With this add-in you can post from Excel directly into SAP, without an upload file, without leaving Excel. Occuring errors are written into a seperate log-tab in the Excel sheet. Furthermore the user can choose to store he posting document in SAP. It seems that our solution fullfills your requirements. Let me know, if you have any other questions.
    There are some videos on www.mkpg.ch showing some of the possibilities. However the are in Swiss German
    Kind regards,

  • How do you center dialogs with multiple monitors. code, best practices

    My existing code will take the pixel size of the java app, and using the size of the dialog, it will center dialogs perfectly in the center of the application. This is great for single monitors, but when multiple monitors are introduced it is a problem. With dual monitor, the dialog is split in half between the two monitors.
    I should be able to determine which pixel/frame initiated the user's action; and then i am hoping to get some code or direction on:
    1. how to determine which monitor the user initiated the action on (knowing the px or frame location, how would i do this)
    2. how to center dialog on that monitor
    if possible, it would be appreciated if you can provide some code; i cant find anything on determing pixel size of monitors and this seems to be a little bit of a project to do from scratch. open source, 3rd party, insight, guidance, all is appreciated. thanks !

    This code may help:
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    public class OptionPaneDemo {
        ActionListener al = new ActionListener() {
            public void actionPerformed(ActionEvent evt) {
                Component comp = (Component) evt.getSource();
                JFrame f = (JFrame) SwingUtilities.windowForComponent(comp);
                showDialogInUpperRightCorner(f);
        public static void main(String[] args) {
            EventQueue.invokeLater(new Runnable(){
                public void run() {
                    new OptionPaneDemo().go();
        void go() {
            GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
            for(GraphicsDevice gd: ge.getScreenDevices()) {
                JButton showDialogButton = new JButton("show the dialog");
                showDialogButton.addActionListener(al);
                JFrame f = new JFrame(gd.getDefaultConfiguration());
                f.getContentPane().add(showDialogButton, BorderLayout.NORTH);
                f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
                f.pack();
                centerWindow(f);
                f.setVisible(true);
        void centerWindow(Window w) {
            Rectangle windowBounds = w.getBounds();
            GraphicsConfiguration gc = w.getGraphicsConfiguration();
            Rectangle screenBounds = gc.getBounds();
            int x = screenBounds.x + (screenBounds.width - windowBounds.width)/2;
            int y = screenBounds.y + (screenBounds.height - windowBounds.height)/2;
            w.setLocation(x, y);
        void showDialogInUpperRightCorner(JFrame f) {
            JOptionPane pane = new JOptionPane("Hello, world!");
            JDialog dialog = pane.createDialog(f, "title");
            Rectangle dialogBounds = dialog.getBounds();
            GraphicsConfiguration gc = dialog.getGraphicsConfiguration();
            Rectangle screenBounds = gc.getBounds();
            //int x = screenBounds.x + screenBounds.width - dialogBounds.width;
            //int y = screenBounds.y == 0 ? 1 : screenBounds.y;
            int x = screenBounds.x;
            int y = screenBounds.y + screenBounds.height - dialogBounds.height-1;
            System.out.format("(%d,%d)%n", x, y);
            dialog.setLocation(x, y);
            dialog.setVisible(true);
    }

  • Code best practice question LV2013

    I am still fairly new to LabVIEW programming and I have been learning from the online self paced classes. I started in June of 2012.
    I am currently working on a new program front panel (host) vi and I am trying to determine a better way to implement a certain section of my code so that it works the way I would like it too. This vi is being designed for a touchscreen interface so all user input is touch screen input.
    What I want the code to do: the code is designed so when the user presses the command button on the front panel vi it creates an information pop-up window explaining the parameters for input. The user pushes the OK button (closes the info pop-up) and opens a new sub-vi that is a numeric keypad. If the user input is within the accepted parameters then when 'enter' is pushed the sub-vi closes and inputs the value to a numeric indicator. If the user inputs an incorrect value, then the keypad sub-vi closes and another info window pops up informing the user 'incorrect value - re-enter value' user hits the OK button and closes the info box and reopens the keypad sub-vi. This cycle should continue until the operator inputs a valid value.
    What the code does as written: when the user presses the command button on the front panel vi it creates an information pop-up window explaining the parameters for input. The user pushes the OK button (closes the info pop-up) and opens a new sub-vi that is a numeric keypad. If the user input is within the accepted parameters then when 'enter' is pushed the sub-vi closes and inputs the value to a numeric indicator. If the user inputs an incorrect value, then the keypad sub-vi closes and another info window pops up informing the user 'incorrect value - re-enter value' user hits the OK button and closes the info box and reopens the keypad sub-vi. If now on the second attempt the user still inputs an incorrect value and presses 'enter' the keypad sub-vi closes and I have had to defer the value to output '0' (or some minimum allowed value).
    So the question I am trying to figure out is this. Is there a better way to implement this section of code to work like I want it to, maybe using shift registers or something and where would they go?
    I am using the most current version of LabVIEW 2013.
    The code as pictured works great outside the fact that I have to stop it after two attempts otherwise the code would have to be rewritten for each failure and it would look like staring off into oblivion between two mirrors.
    Thanks,
    Solved!
    Go to Solution.
    Attachments:
    code question.jpg ‏429 KB

    Gearmiester wrote:
    What I want the code to do: the code is designed so when the user presses the command button on the front panel vi it creates an information pop-up window explaining the parameters for input. The user pushes the OK button (closes the info pop-up) and opens a new sub-vi that is a numeric keypad. If the user input is within the accepted parameters then when 'enter' is pushed the sub-vi closes and inputs the value to a numeric indicator. If the user inputs an incorrect value, then the keypad sub-vi closes and another info window pops up informing the user 'incorrect value - re-enter value' user hits the OK button and closes the info box and reopens the keypad sub-vi. This cycle should continue until the operator inputs a valid value.
    Why do you check for valid entry outside the sub-vi that allows the operator to input a value?  You could simply monitor each keystroke (every character entered) and have a small algorithm that checks for a correct entry on the fly (while it is being entered).  You could change the color of the text to red and make a brief description appear below the string control which describes valid entries.  Keep it simple.
    Gearmiester wrote:
    What the code does as written: when the user presses the command button on the front panel vi it creates an information pop-up window explaining the parameters for input. The user pushes the OK button (closes the info pop-up) and opens a new sub-vi that is a numeric keypad. If the user input is within the accepted parameters then when 'enter' is pushed the sub-vi closes and inputs the value to a numeric indicator. If the user inputs an incorrect value, then the keypad sub-vi closes and another info window pops up informing the user 'incorrect value - re-enter value' user hits the OK button and closes the info box and reopens the keypad sub-vi. If now on the second attempt the user still inputs an incorrect value and presses 'enter' the keypad sub-vi closes and I have had to defer the value to output '0' (or some minimum allowed value).
    Why is the 2nd attempt different than the others?  It does not matter how many attempts are made... since it is not an automated process, but human interaction.  Surely, the operators are trained and would have an idea of what should be entered.  Additional instructions can be provided within documentation that accompanies the application.
    Gearmiester wrote:
    So the question I am trying to figure out is this. Is there a better way to implement this section of code to work like I want it to, maybe using shift registers or something and where would they go?
    I am using the most current version of LabVIEW 2013.
    The code as pictured works great outside the fact that I have to stop it after two attempts otherwise the code would have to be rewritten for each failure and it would look like staring off into oblivion between two mirrors.
    Do you absolutely want it to work as described within your first paragraph?  There are always "better ways" to do things, that's a personal preference..  Maybe you should ask the people that will be using the application to get their feedback (operators).  That's what I usually do.
    Using the latest LabVIEW version is fine, but has little or no impact on the implementation decisions. 
    If all you really want is to fix the code to prevent it from stopping after 2 attempts, then show us a code snippet of what you have done.

  • Best Practice for Use of ABAP in Customizing SRM and/or CRM

    I was wondering if there is a document that defines best practices for the use of ABAP with the installation and customization of SRM and/or CRM.   Such as amount of ABAP coding typically required, and best practices around the use of ABAP for customization and configuration.
    Thanks.

    Hi, Johnson
    Sorry, Please don't mind, you are not at right place to ask the Question like this
    Please read "The Forum Rules of Engagement" before posting!  HOT NEWS!!
    Thanks and Regards,
    Faisal

  • Seaching for Best Practice links that work

    Hi,
    past few years I have been able to access SAP Best Practices documents like SAP Best Practices SAP Best Practices for CP and Wholesale Industries
    (this one still works and guides me to the building block and process overview documents!).
    Recently any link I can find to SAP Industry or Baseline Best Practices ends up with a dead link. See for example trying to get from here SAP Best Practices Baseline packages – SAP Help Portal Page
    to Localized for Netherlands V1.607 SAP Best Practices package further below on that page, results in screen shot attached. I have seen that in many more examples (different countries, or in Industry Best Practice Packages instead of Country Baseline packages....)
    Does any know whether and how SAP redesigned their access to Best Practices documents (Configuration Guides, eCatts, Scenario Process Overviews etc.?
    Thanks for your reply.
    Thijs

    Hi, Thijs,
    There is currently a problem with Best Practices on the Help Portal.  On the home page of the portal (http://help.sap.com/) there is a message that reads "Stay Tuned - There are temporary problems when accessing some content types, for example PDF documents or Best Practices. We are working on a solution."
    Our Wholesale Distribution industry group does not manage the Help Portal pages, so, unfortunately, I don't know the status of the problem or when it might be resolved.
    Lynn

  • Best Practice for module components based on API's

    Hi all,
    is there a white paper/other documents which outline best
    practice for using table/module component api's and best
    approaches to get around restrictions?
    I would also appreciate war stories about using this method of
    Forms development bearing in mind i would be using this as the
    foundation of a web deployed based application (intranet first -
    ultimately internet).
    Thanks
    Mark
    null

    You cannot add agents to skills dynamically; however, you can queue the caller into more than one CSQ based on statistics. You would use the Get Reporting Statistics and an If step within the Queued branch of your first Select Resource step. If the condition is met (e.g. Contacts Waiting >= 10) then exectue a second Select Resource step within the queued branch of the first. The contact would then be waiting in both CSQs waiting for an agent.

  • Best Practices in use of ABAP for SRM and/or CRM Configuration

    I was wondering if there is a document that defines best practices for the use of ABAP with the installation and customization of SRM and/or CRM. Such as amount of ABAP coding typically required, and best practices around the use of ABAP for customization and configuration.
    Thanks.

    Hi, Johnson
    Sorry, Please don't mind, you are not at right place to ask the Question like this
    Please read "The Forum Rules of Engagement" before posting!  HOT NEWS!!
    Thanks and Regards,
    Faisal

  • What is best practice for using Maintenance Optimizer to download SPS + EhP

    SAP indicates in note 1095233 and many other documents that the best practice is to implement an EhP along with an SP Stack in the same queue. Furthermore, the only way to download the components of an EhP is via Maintenance Optimizer. However, in step 2 (Calculate download files automatically) you must choose either Maintenance (SPS) or Enhancement Package Installation (EhP); there is no way to tell Maintenance Optimizer that you want to download both SPS and EhP.
    In developing the process for my team I circumvented the problem by saying to select Maintenance first to get the SPS into the Download Basket and follow that with selecting Enhancement Package Installation to get the EhP into the Download Basket. The plan would be to include all the downloads in the SPAM/SAINT queue with the expectation that SPAM/SAINT will be able to determine what must be included.
    I'm wondering now whether that is a legitimate way to approach this and I am hoping others will share their process.
    Thanks,
    Terry McCann
    Monsanto Company
    St. Louis, MO

    Actually, I don't believe you will get the entire SP Stack for ERP 6, you only get those pieces of the stack that are required for the Technical Usages you select for the EhP.  I'm basing that on my observation that you get a different subset of the files making up the stack depending upon your TU selection. Also, note 1095233 specifically states:
    If now the corrections included in the enhancement package 3 correspond to ERP 6.0 SP level 11, SAP  recommends to update also the parts of your system to SP level 11 which you do not want to update to enhancement package 3  to achieve a consistent correction level in all parts of your application: SAP recommends to update all software components to the correction status corresponding to SAP ERP 6.0 Support Package Stack 11 with the installation of SAP enhancement package 3 for SAP ERP 6.0.
    Thanks,
    Terry

  • Standard/best practice of Naming for MM authorisations

    Dear All,
    Can anybody please send the document related standard/best practice for naming convention for MM roles in authorisation.
    As we want to redo the authorisation system for a Client right from the scratch.(Already having SAP).
    to have an idea on standard/best practice of giving naming convention,i need the connected document.
    Can any body please send to my mail id: [email protected]
    Advance thanks.
    Regards,
    Dayanand

    Dear,
    Usually the role nomenclature is for the company as a whole
    Hence the std way is as below
    XX- 2 leter to repsenet the module
    XXXXXXXXXXXX-To represent the function(example-phy inv)
    XXXX-to repsent the plant it is applicable
    XXXX-to present- is it create/change/display/execute....
    XXXX- to repsent the variant
    hence it is as below
    Role is as below
    XX:XXXXXXXXXXXX:XXXX:XXXX:XXXX

  • What is the best practice for the WLI?

    Hello to everyone,
    I am a newbie to the Weblogic Integration Server and I had read the docs of WLI
    from the BEA, like "Programming BPM Client Applications". But I found it is bitter
    and astringent. I am wondering there is documents and samples for Weblogic Intergration
    Server for the entry level. I 'd appreciate it if anyone could give some comments.
    Thanks.
    Leon

    I was wondering if anybody knew of any bea documents that outlined best practices
    in terms of naming standards for business operations, event keys, tasks etc...
    "Tinnapat Chaipanich" <[email protected]> wrote:
    Hi
    Why not try BPM tutorial :)
    http://edocs.bea.com/wli/docs70/bpmtutor/index.htm
    Regards,
    Tinnapat.
    "Leon" <[email protected]> wrote in message
    news:3ea7ffbd$[email protected]..
    Hello to everyone,
    I am a newbie to the Weblogic Integration Server and I had read thedocs
    of WLI
    from the BEA, like "Programming BPM Client Applications". But I foundit
    is bitter
    and astringent. I am wondering there is documents and samples for WeblogicIntergration
    Server for the entry level. I 'd appreciate it if anyone could givesome
    comments.
    Thanks.
    Leon

  • Best Practices for Implementing BI7.0

    Dear all,
    We are currently in BI 3.5 and have planned to go for BI 7.0.I have a few questions
    1. Is the BI in Netweaver 2004s is BI7.0?
    2. What are the best practices to go for BI 7.0? I found few documents regarding the Best Practices in service.sap.com
    3. Where can I find more detailed information and documents for implementing BI7.0?
    If you have any document can you please send it to
    (yo - no email addresses in here buddy boy)
    Thanks & Regards,
    Chandran Gansan
    Message was edited by: Ron Silberstein

    Dear Chandran,
      1. Is the BI in Netweaver 2004s is BI7.0?
    >> I read some posts before that the correct term should be SAP Netweaver 2004s; Whereas the SAP BW3.5 is referred to SAP Netweaver 2004. I hope I am not mistaken.
      2. What are the best practices to go for BI 7.0? I found few documents regarding the Best Practices in service.sap.com
      3. Where can I find more detailed information and documents for implementing BI7.0?
    >> Since you have access to the SAP service marketplace, kindly check under the categories: bi, bifaq, sevices & implementation.
      Hope this helps..
      Thanks...

  • Best Practice & BPP for HCM

    Hi,
    Can anyone please advise me the link for the following:
    Business Process Procedure document for HCM (Best Practice Scenarios).[Module wise PA,OM,TIME,Payroll,Benefits etc]
    Config document for HCM (Best Practice Scenarios).[[Module wise PA,OM,TIME,Payroll,Benefits etc]]
    Regards
    Manish

    Hi ,
    There are no specific set of steps / practices for batch loading contents to ucm . It would be very much dependent on how many contents does the user have to load to UCM and how well the server is configured in terms of performance .
    You can get more details from the following documentation link : http://docs.oracle.com/cd/E21043_01/doc.1111/e10792/c02_settings009.htm
    Thanks,
    Srinath

Maybe you are looking for