Designing JFrame Application in better way

I am going to start the design of a Kiosk Based Application which consists of nearly dozens of screen and the application must be full screen and undecorated. In this situation what will be the best GUI design strategy?
1) I have designed 3-4 screens using MVC style which uses JFrame. But while moving from one JFrame screen to another it flickers and shows the background and the switching is slow.
2) Can I use JPanel in each screen design (this JPanel will have GUI for one screen) and set them visible as per the condition on single JFrame. Will this technique will be efficient or can I face any problem in future due to design of GUI only on one JFrame.

This is the demonstration code on which I am working.
In this application while moving from second to third screen flickering occurs while in other case the transition is smoother the problem is between second and third frame. How to avoid this, any tick? or by adding sleep?
import java.awt.BorderLayout;
import java.awt.EventQueue;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.HashMap;
import javax.swing.JButton;
import javax.swing.JFrame;
public class FrameExample {
    public static void main(String[] args) {
        EventQueue.invokeLater(new Runnable() {
            public void run() {
                Controller      viewController      = new Controller();
                MainView      main                = new MainView(viewController);
                DetailView      detail                = new DetailView(viewController);
                ThirdView      Third_Screen     = new ThirdView(viewController);
                viewController.showView("Main");
    static class Controller {
        HashMap<String,JFrame> views;
        public Controller(){
            views = new HashMap<String,JFrame>();
        public void registerView(String name, JFrame view){
            views.put(name,view);
        public void showView(String name){
            if (views.containsKey(name)){
                for (String key : views.keySet()){
                    views.get(key).setVisible(key.equals(name));
    static class MainView extends JFrame {
        final Controller viewController;
        public MainView(Controller controller){
            super();
            this.viewController = controller;
            setTitle("Main");
            setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            getContentPane().setLayout(null);
            JButton button = new JButton("Frame 1--Show Detail");
            button.setBounds(300,300,160,80);
            button.addActionListener(new ActionListener() {
                public void actionPerformed(ActionEvent e) {
                 try{
                 viewController.showView("Detail");                                 
                //Thread.currentThread().sleep(100);               
                }catch(Exception e1){}
            getContentPane().add(button, BorderLayout.SOUTH);
            setSize(1024, 786);
            setUndecorated(true);
            viewController.registerView(getTitle(), this);
    static class DetailView extends JFrame {
        final Controller viewController;
        public DetailView(Controller controller){
            super();
            this.viewController = controller;
            setTitle("Detail");
            setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            getContentPane().setLayout(null);
            JButton button = new JButton("Frame 2--Show ThirdView");
            button.setBounds(300,300,160,80);
            button.addActionListener(new ActionListener() {
                public void actionPerformed(ActionEvent e) {
                    try{                         
                 viewController.showView("Third_Screen");                 
               // Thread.currentThread().sleep(400);
                }catch(Exception e2){}
            getContentPane().add(button, BorderLayout.SOUTH);
            setSize(1024, 786);
            setUndecorated(true);
            viewController.registerView(getTitle(), this);
    static class ThirdView extends JFrame {
        final Controller viewController;
        public ThirdView(Controller controller){
            super();
            this.viewController = controller;
            setTitle("Third_Screen");
            setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            getContentPane().setLayout(null);
            JButton button = new JButton("Frame 3--Show Main");
            button.setBounds(300,300,160,80);
            button.addActionListener(new ActionListener() {
                public void actionPerformed(ActionEvent e) {
                    try{                         
                 viewController.showView("Main");                 
                //Thread.currentThread().sleep(100);
                }catch(Exception e2){}
            getContentPane().add(button, BorderLayout.SOUTH);
            setSize(1024, 786);
            setUndecorated(true);
            viewController.registerView(getTitle(), this);
}

Similar Messages

  • Designing Web applications for better performance

    Hi,
    Let me explain the scenario.
    We are following MVC architecture, where we have our JSP pages interacting with a controller
    servlet , which decides what action to performed . It is using request despatcher method to redirect
    the request object to jsp pages.
    We have most of jsp pages as entry screens. We are not using java beans, fearing the complexity of master
    details forms . ( we dont know how to use "bean technolagy" in case of detail entry screens).
    In forms at a time we can have max 50 rows , with each row having 10 columns. When a particular page
    need to be displayes for editing (may be with already existing data), the servlet will populate objects
    and jsp will access data from these objects. Once the data is accessed , these objects will be removed
    from the session.
    Since we are removing the objects from the session (not keeping it certain amount of time too), if the
    servlet /another jsp requires some information, we are forced to use "hidden variables". In the current
    scenario, we are having at least 40-50 hidden variables passing from a jsp page to servlet.
    We decided not to use session objects fearing that it will give lot of problem to server. But now it
    is making our client "fat".
    Eventhogh our application is big, we are not using any database side coding like triggers,stored procedures
    etc? Is this create performance problems?
    When our application runs, many times we can find that the request will not get processed correctly
    in jrun sever or some times we gets blank window or some time jrun default server hangs.
    we are using Jrun 3.0 and Solaris_JDK_1.2.2_05.
    Pl. find my following questions.
    1. is this right way to do the things (hidden variables).
    2. Is creating session variables is going to hamper the performance of the system?

    Dear sandhyavk,
    From my experience, you are better to put your hidden values into a JavaBean, simply a data object which is saved in a session, after you have accessed to it, you simply invalidate the session indeed. You can find more details from the following links from javaworld.com, I have adopted and amended it for my eIPO system, it is flexible and easy to maintain and understand.
    * http://www.javaworld.com/javaworld/jw-01-2001/jw-0119-jspframe.html
    * http://www.javaworld.com/javaworld/jw-01-2001/jw-0119-jspframe.html
    I do hope that it can give you some ideas.
    Best regards,
    Anthony Lai

  • I've lost iWeb and thus my web design.  I must start from scratch.  Should I reinstall iWeb 09 and use that, or is there a better way?

    I've lost iWeb and thus my web design.  I must start from scratch.  Should I reinstall iWeb 09 and use that, or is there a better way?

    The file you really need is named Domain.sites2 which resides in your   Home/Library/Application Support/iWeb foldler.  It's independent from the iWeb application. If it's not in there do you have a backup of your hard drive from an earlier time? 
    Resinatll iWeb 3 from the iLife 09 disk or wherever you got it from originally and then try what's described below:
    In Lion and Mountain Lion the Home/Library folder is now invisible. To make it permanently visible enter the following in the Terminal application window: chflags nohidden ~/Library and press the Return key - 10.7: Un-hide the User Library folder.
    To open your domain file in Lion or Mountain Lion or to switch between multiple domain files Cyclosaurus has provided us with the following script that you can make into an Applescript application with Script Editor. Open Script Editor, copy and paste the script below into Script Editor's window and save as an application.
    do shell script "/usr/bin/defaults write com.apple.iWeb iWebDefaultsDocumentPath -boolean no"delay 1
    tell application "iWeb" to activate
    You can download an already compiled version with this link: iWeb Switch Domain.
    Just launch the application, find and select the domain file in your Home/Library/Application Support/iWeb folder that you want to open and it will open with iWeb. It modifies the iWeb preference file each time it's launched so one can switch between domain files.
    WARNING: iWeb Switch Domain will overwrite an existing Domain.sites2 file if you select to create a new domain in the same folder.  So rename your domain files once they've been created to something other than the default name.
    OT

  • A better way to Double Click

    I have been wondering if there is a better way to detect single clicks Vs double clikcs than the model currently implemented. I am sure all of you have run into the problem of even though an event listener detects a double click eventually, it detects the single click first, so often you have to compromise the quality of your software to account for that. I have considered writing my own custom handler using threads and such, but it seems to me there must be a better way out there that I just have not been able to find. I need a way to detect double clicks, and fool the machine into believing no single click has occured. Must I re-invent the wheel?
    AC

    I agree that GUIs should have some uniformity to
    them..especially as we enter an age where computers
    are ubiquitous. But there are some situations where
    customized behavior is preferrable. If you have ever
    worked with movie special effects software, some art
    software, music software, especially, you know that to
    make a GUI intuitive, sometimes liberties must be
    taken with the 'standard' gui design.The application determines the standard not the OS nor the GUI.
    And to say 'Your code is not standard, therefore the
    fact that java cannont accurately distinguish between
    single and double clicks is your problem' smacks of
    nonsense to me.
    We all know that Java is a great
    language.Java is not just a language it is a platform and a philosophy.
    It is quicker and easier to program in,
    than c++, but it is not at full maturity. Every c++
    development environment I have ever used had the
    ability built in to distinguish between a true single
    click and a double click.As does Swing..
    I love Java, but most
    programmers could fill a page with the enhancements
    that it needs. Not all enhancements are practical.
    Like many I balked when I first started with Java at
    the fact that it did not have true multiple
    inheritence. I now realize that
    I never really needed it anyway. But some things, eg
    templates, I definitely could still use. That being,
    said, thanks for the dialog. Templates are a complicated horror, unless you really need your software to be truly adaptable you will never use them. Even MS, Sun and IBM disposed of that need a long time ago.

  • Design of application service

    Hello CAF Experts,
    I created a CAF business object with some entity service. Now I would like to create an application service on top of that. The question is how should this be designed.
    Is there a way to call CAF entity service directly from the new application service. If so, has anybody a coding example?
    Or is it the better way to import the entity services as external webservices and access them from the new application service? Also here I would appreciate a little coding example.
    Thanks,
    Michael

    hi,
    For Business Objects:
    You have created the Business Objects all ready.
    Now, Create an application service. Add your Business Objects as dependency to the application service so that you can access these business objects in the application service.
    For example, Travel is a Business Object. TravelAS is an application service. Now add Travel as a dependency to the TravelAS. In the TrvelAS, You can access Travel using the following code.
    List<Travel> travelList = this.getTravelService().findByStartLocation(
                        startLocationQF);
    [Creating application service.|http://help.sap.com/saphelp_nwce711/helpdata/en/45/173644c24026cae10000000a11466f/content.htm]
    For external services:
    First you import the external saervice(Web service/ RFC) in to your project. Then create application service and do default mapping between your imported external service and this application service. The application service acts as a wrapper for the external service.
    [Architectural Guidelines for Business Logic|http://help.sap.com/saphelp_nwce711/helpdata/en/45/173644c24026cae10000000a11466f/content.htm]
    Thanks

  • Designing an application so extra comopnents can be added later

    Hi all
    I'm about to start designing a new application, but would like to design it in away that I can add new modules at a later date without me having to alter the existing app.
    Basically these new modules will be small apps that will do there own thing, but will be fired from the main app, and when they are closed you return to the main app. So after a while I will have an application with loads of seperated modules which will be optional for the user to add when installing the app depending on whether they need them.
    I was thinking of having some sort of add/remove module dialogbox which will allow the user to select a new module to add or remove etc. But what is the best way to design the app so that these modules can be added. Do i use the class loadder to load the classes dynamically at runtime or develop the modules as seperated programs and fire them up from main program as needed?
    Any ideas would be great.
    Thanx
    Gerard

    Hey,
    First off, I don't know if I stated it wrong earlier, or perhaps I am not understanding what you mean, but my UI framework has nothing to do with eclipse at all. It is built around my plugin engine and Swing, completely. It has no outside dependencies other than my plugin engine, the rest is all JDK (thus far). The engine itself has a embeded xml parser, that is it. It doesn't rely on any logging api, or any other outside api. So using my UI framework is thus far all wrapped around the JDK API.
    Can you elaborate a bit more on what you mean by allowing a specific mandatory list of plugins, and optional? Should an application specify required plugins, then anything else found in some dirs are loaded after that? I ask this because a dilema I am running into with my UI framework is how to apply menu items in a certain order. My engine does not load plugins in a specific order or priority, first come first server as they are found. Problem is, if one plugin adds a QUIT menu item, and another an OPEN item, and OPEN appears AFTER QUIT because it is loaded after the plugin that provides QUIT, it looks wrong. So I am sort of stuck right now on how to allow plugins written by different people to build a solid menu tree without an inconsistent structure. We wouldn't want Help on the left and File on the right, but that is possible right now with my UI framework. One thought was to make my UI plugin set up the basic menu structure, with File -> Open, Save, Save As, and Exit, and a Help on the far right, and anything else gets added in between. This would be partially ok, only that some apps may not need a File menu, or a Help menu, so I don't want to enforce this behavior.
    I am also not sure I understand what you mean by a plugin specifying requirements? Can you elaborate a bit more on that? Maybe give an example, something you may already do with your code?
    Finally, some good ending points. I agree the end result is what the client wants, assuming the app you are working on is for a client. I also see where a pluggable architecture appeals greatly to a development community, such as in the case of Eclipse. 90% of the recipients of plugins are developers themselves. Naturally, it being a productivity tool for developers, this makes sense. But having worked with audio applications that are also heavily plugin centric, it seems to me a lot of clients are well aware of what plugins are and how to obtain them for their needs. What I am saying is that while the end result may be that a client doesn't much care about the concept of a plugin, just that it works, there are plenty of cases where client applications are heavily plugin centric and would require some knowledge of what a plugin is, how to obtain updates, possibly how to turn them on/off, add/remove, etc. Perhaps in some cases these types of tasks are higher level, such as turning on an FX option in a photo program may actually load the plugin, without the end user realizing they are dealing with a plugin.
    At any rate, I thought I said, but if not, I in no way was trying to imply what you have done is "easy". No doubt you have spent a lot of time developing and know what you are doing. I guess my focus is the underlying manner in which my engine handles plugins. It is more like a servlet or ejb container in that it provides a number of services for plugins to use and maintains a number of things so that plugin developers don't have to worry about it.
    At any rate, I appreciate the continued correspondence. I would enjoy your looking at what I have done, check out the source, taking it for a spin, see what you think. More eyes are better, and hopefully offer more ideas, better ways of doing something, etc.
    Thanks.

  • Can some one tell me a better way...

    Hi All..
    I work on a web application. I create user ids for people logging into my application. here I have a small problem.. This is what I am currently doing...
    When I create a new user, I assign a new user id to the user and store all hi info.
    All our user ids are stored in User_ID table and user info in User_Info table.
    First I get the max user id from the User_Id table.
    int iuserid = select max(User_ID) from User_ID;
    Then I add ' 1 ' to this and assign it to new user.
    iuserid = iuserid+1;
    insert into User_id values(iuserid, <ssn> );
    Then I store all user info in User_info table..
    insert into User_info(iuserid, <first_name>, <last_name>,...);
    Both these SQLs are executed as a transaction.
    The problem that I have...
    It works fine in a normal environment and in my testing.
    But when the load inceases, before I insert into the User_info, another user tries to get the max User_id from User_ID table, then it conflicts..
    I have seen occurences of User_Info storing the info of a different user against the User_id when many people are accessing the app at the same time.
    Can some one tell me a better way to handle this scenario..
    Appreciate all you help..
    TIA..
    CK

    Hi,
    assuming that the requirement for user_id is only for uniqueness (primary key requirement) not continuosly.
    perhaps can try this,
    1) create a table to keep the max id for each table's key.
    e.g.
    create table key_id_lookup
    key_name char(n),
    current_value number(m)
    where n & m is the size of the field
    2) for each creation of entry in the user_id table, lookup the value in the key_id_table and increment it after retrieval.
    e.g. current_id = select current_value from key_id_lookup where key_name = 'user_id_key';
    current_id+=1;
    update key_id_lookup set current_value = current_id where key_name = 'user_id_key';
    something similar to use of sequence if your database support it.
    3) continue with the creation of record in other tables. now obtain the time stamp of creation and append with the current_id obtained. e.g. timestamp = 132456872; size of m is 5, user_id = 132456872 x 100000 + current_id;
    this should give you a unique key at creation time.
    There should be other better ways of resolving this(like locking the table for the update operation but affect performance, etc), depending on the feature supported by the database in use.
    Hope this can help as last resort if other options not available.

  • A better way to initialize imported taskflows and BCs with current user

    Hello.
    I'm currently developing a composite application containing one main application and a number of subapplications (modules) packed in adflibs.
    Main application has a side menu and a dynamic region, showing taskflows (on fragments) from adflibs.
    Main application is configured with adf security and it has current login and queries his ID. I would like main application to tell modules current user ID rather than each module to find out current user on their own.
    So there is currentUserID input parameter required in each imported taskflow. And my question is what is a better way to process this ID in the modules?
    What I have previously done is:
    I've created a custom BC classes layer, VOImpl and VORowImpl have getIdUser() method. This method reads currentUserID parameter from pageFlowScope where the taskflow is storing the parameter.
    Top-level View Objects have :IdUser query parameter and corresponding bind variable. This bind variable has value="source.getIdUser()", calling the method from custom VO class.
    This way works fine but here and there I read that it is a bad practice to access pageFlowScope from BCs.
    I could agree with this in case someone could share a better way.
    So what is a good practice?
    Thanks.
    ADF/JDev 11.1.2.3 - 12

    Why don't you use adf security for this? Read Oracle ADF: Security for Everyone which give you an overview and sample on how to implement this.
    Timo

  • A better way to make Automator mount a volume?

    I made an Automator application, using the Record function, to mount a volume on a drive connected to my Mini. I also made a similar one to eject it. I use them as Calendar-triggered events as part of my backup scheme.
    They work well ... until I restart the Mini, when occasionally my two connected drives will mount in a different order. What happens then is that the sequence of mouse clicks recorded in Automator don’t find the correct volume.
    I wonder if there’s a better way to automate the mounting of a currently ejected disc (and later its ejection). Automator, as far as I can see, does not have the actions I need. It has Ask For/Connect to/Get specified Servers, but they seem only to be for network-connected stuff.
    Anyone know a better way?

    Welcome to Unix. 
    The key part of that shell script code is the test for the existence of the mount point (if [ -e /Volumes/dbamp ]), followed by a conditional block that — in the "else" section involved when the mount point wasn't found — creates it, and then mounts an AFP file system on that mount point.  Most of the rest of the baggage in that script is used to get the mysqldump database dumps over onto the target disk, once it's been mounted.
    Here's a very quick overview of the basics of scripting , Apple's introduction to the command line manual, there's a generic bash intro (which is good, but doesn't line up exactly with how bash is implemented on OS X) and O'Reilly has some reasonable books on bash and bash scripting.  Once you know and are comfortable with the basics, there are advanced bash guides available.

  • A better way to refresh data

    Hey everyone, I'm creating a Flex/ColdFusion app. and I've
    been working with CFCs and RemoteObjects. I know that when you want
    to refresh data you have to call the CFC with the RemoteObject
    every time (after the creationComplete is called I use addedToStage
    and removedFromStage to re-call the CFC). Is there a better way to
    refresh my data or "re-initialize" the component?
    Also, does anyone know the proper way to log someone out
    using ColdFusion and Flex? I pass the cflogout method in my CFC and
    in Flex I return the user to the login page and "reset" my objects
    I use to store user data, but after logging in as a different user
    the previous user's info is still present. So I've resorted to
    reloading the URL to clear the application of all data. Any tips?
    Thanks,
    PJ

    I don't really get what you mean with "re-initialize the
    component"?
    Here you can learn about login and logout in ColdFusion.
    http://www.brucephillips.name/blog/index.cfm/2006/11/27/Login-and-Logout-Flex-Example-That -Uses-ColdFusion-CFLogin-and-CFC-Role-Security

  • Is there a better way to do this projection/aggregate query?

    Hi,
    Summary:
    Can anyone offer advice on how best to use JDO to perform
    projection/aggregate queries? Is there a better way of doing what is
    described below?
    Details:
    The web application I'm developing includes a GUI for ad-hoc reports on
    JDO's. Unlike 3rd party tools that go straight to the database we can
    implement business rules that restrict access to objects (by adding extra
    predicates) and provide extra calculated fields (by adding extra get methods
    to our JDO's - no expression language yet). We're pleased with the results
    so far.
    Now I want to make it produce reports with aggregates and projections
    without instantiating JDO instances. Here is an example of the sort of thing
    I want it to be capable of doing:
    Each asset has one associated t.description and zero or one associated
    d.description.
    For every distinct combination of t.description and d.description (skip
    those for which there are no assets)
    calculate some aggregates over all the assets with these values.
    and here it is in SQL:
    select t.description type, d.description description, count(*) count,
    sum(a.purch_price) sumPurchPrice
    from assets a
    left outer join asset_descriptions d
    on a.adesc_no = d.adesc_no,
    asset_types t
    where a.atype_no = t.atype_no
    group by t.description, d.description
    order by t.description, d.description
    it takes <100ms to produce 5300 rows from 83000 assets.
    The nearest I have managed with JDO is (pseodo code):
    perform projection query to get t.description, d.description for every asset
    loop on results
    if this is first time we've had this combination of t.description,
    d.description
    perform aggregate query to get aggregates for this combination
    The java code is below. It takes about 16000ms (with debug/trace logging
    off, c.f. 100ms for SQL).
    If the inner query is commented out it takes about 1600ms (so the inner
    query is responsible for 9/10ths of the elapsed time).
    Timings exclude startup overheads like PersistenceManagerFactory creation
    and checking the meta data against the database (by looping 5 times and
    averaging only the last 4) but include PersistenceManager creation (which
    happens inside the loop).
    It would be too big a job for us to directly generate SQL from our generic
    ad-hoc report GUI, so that is not really an option.
    KodoQuery q1 = (KodoQuery) pm.newQuery(Asset.class);
    q1.setResult(
    "assetType.description, assetDescription.description");
    q1.setOrdering(
    "assetType.description ascending,
    assetDescription.description ascending");
    KodoQuery q2 = (KodoQuery) pm.newQuery(Asset.class);
    q2.setResult("count(purchPrice), sum(purchPrice)");
    q2.declareParameters(
    "String myAssetType, String myAssetDescription");
    q2.setFilter(
    "assetType.description == myAssetType &&
    assetDescription.description == myAssetDescription");
    q2.compile();
    Collection results = (Collection) q1.execute();
    Set distinct = new HashSet();
    for (Iterator i = results.iterator(); i.hasNext();) {
    Object[] cols = (Object[]) i.next();
    String assetType = (String) cols[0];
    String assetDescription = (String) cols[1];
    String type_description =
    assetDescription != null
    ? assetType + "~" + assetDescription
    : assetType;
    if (distinct.add(type_description)) {
    Object[] cols2 =
    (Object[]) q2.execute(assetType,
    assetDescription);
    // System.out.println(
    // "type "
    // + assetType
    // + ", description "
    // + assetDescription
    // + ", count "
    // + cols2[0]
    // + ", sum "
    // + cols2[1]);
    q2.closeAll();
    q1.closeAll();

    Neil,
    It sounds like the problem that you're running into is that Kodo doesn't
    yet support the JDO2 grouping constructs, so you're doing your own
    grouping in the Java code. Is that accurate?
    We do plan on adding direct grouping support to our aggregate/projection
    capabilities in the near future, but as you've noticed, those
    capabilities are not there yet.
    -Patrick
    Neil Bacon wrote:
    Hi,
    Summary:
    Can anyone offer advice on how best to use JDO to perform
    projection/aggregate queries? Is there a better way of doing what is
    described below?
    Details:
    The web application I'm developing includes a GUI for ad-hoc reports on
    JDO's. Unlike 3rd party tools that go straight to the database we can
    implement business rules that restrict access to objects (by adding extra
    predicates) and provide extra calculated fields (by adding extra get methods
    to our JDO's - no expression language yet). We're pleased with the results
    so far.
    Now I want to make it produce reports with aggregates and projections
    without instantiating JDO instances. Here is an example of the sort of thing
    I want it to be capable of doing:
    Each asset has one associated t.description and zero or one associated
    d.description.
    For every distinct combination of t.description and d.description (skip
    those for which there are no assets)
    calculate some aggregates over all the assets with these values.
    and here it is in SQL:
    select t.description type, d.description description, count(*) count,
    sum(a.purch_price) sumPurchPrice
    from assets a
    left outer join asset_descriptions d
    on a.adesc_no = d.adesc_no,
    asset_types t
    where a.atype_no = t.atype_no
    group by t.description, d.description
    order by t.description, d.description
    it takes <100ms to produce 5300 rows from 83000 assets.
    The nearest I have managed with JDO is (pseodo code):
    perform projection query to get t.description, d.description for every asset
    loop on results
    if this is first time we've had this combination of t.description,
    d.description
    perform aggregate query to get aggregates for this combination
    The java code is below. It takes about 16000ms (with debug/trace logging
    off, c.f. 100ms for SQL).
    If the inner query is commented out it takes about 1600ms (so the inner
    query is responsible for 9/10ths of the elapsed time).
    Timings exclude startup overheads like PersistenceManagerFactory creation
    and checking the meta data against the database (by looping 5 times and
    averaging only the last 4) but include PersistenceManager creation (which
    happens inside the loop).
    It would be too big a job for us to directly generate SQL from our generic
    ad-hoc report GUI, so that is not really an option.
    KodoQuery q1 = (KodoQuery) pm.newQuery(Asset.class);
    q1.setResult(
    "assetType.description, assetDescription.description");
    q1.setOrdering(
    "assetType.description ascending,
    assetDescription.description ascending");
    KodoQuery q2 = (KodoQuery) pm.newQuery(Asset.class);
    q2.setResult("count(purchPrice), sum(purchPrice)");
    q2.declareParameters(
    "String myAssetType, String myAssetDescription");
    q2.setFilter(
    "assetType.description == myAssetType &&
    assetDescription.description == myAssetDescription");
    q2.compile();
    Collection results = (Collection) q1.execute();
    Set distinct = new HashSet();
    for (Iterator i = results.iterator(); i.hasNext();) {
    Object[] cols = (Object[]) i.next();
    String assetType = (String) cols[0];
    String assetDescription = (String) cols[1];
    String type_description =
    assetDescription != null
    ? assetType + "~" + assetDescription
    : assetType;
    if (distinct.add(type_description)) {
    Object[] cols2 =
    (Object[]) q2.execute(assetType,
    assetDescription);
    // System.out.println(
    // "type "
    // + assetType
    // + ", description "
    // + assetDescription
    // + ", count "
    // + cols2[0]
    // + ", sum "
    // + cols2[1]);
    q2.closeAll();
    q1.closeAll();

  • Is there any better way for updating table other than this?

    Hi all, I need to update a row in the table that require me to search for it first (the table will have more than hundred thousands of row). Now, I am using a LOV that will return the primary key of the row and put that primary key to DEFAULT_WHERE property in the block and execute query command to fetch the row that need updating. This works fine except that it require 2-query-trip per update (the lov and the execute_query). Is there any better way to doing this? This update is the main objective for my application and I need to use the most effective way to do it since we need to update many records per hour.

    Thanks Rama, I will try your method. Others, how to query row instead of primary key? I thought that querying primary key is faster due to the index?
    BTW, what people do if you need to update a table using Form? I have been using the LOV then execute query since I first developing form. But I am building a bigger database recently that I start worrying about multiple query trip to dbms.
    FYI my table will have up to million rows on it. Each row will be very active (updated) within 1-2 weeks after it creation. After that it will exist for records purposes only (select only). The active rows are probably less than 1% of all the rows.

  • Easier and better ways to solve current problems with Acrobat?

    Is there no better and easier way to solve the problems (installation, re-installing and crashing) with Acrobat? I really think that the ball is in Acrobat's corner right now, because I should not (for example) need to deactivate and re-activate my subscription in order to get AcrobatPro XI to work on my computer, let alone deinstalling an older version that (for now) does work, risking that in the end neither of them work. I need the (great) AdobeCloud applications to do my work as a freelancer, and I really cannot afford this kind of trouble with my applications, nore loose time repairing them. These are difficult times as it is.
    Regards,
    Marc

    Sorry, I can't. When I installed it there was no message that said I had to deinstall the old version first, and with other Adobe CC applications there had been no trouble at all, so I installed it with The previous version still on my computer.
    After installing, neither of them would start up properly, so I deinstalled version XI, after which the old version worked again, but my Adobe Application Manager does not let me download the XI version a second time, so I cannot try again.
    Regards,
    Marc
    Op 7 dec. 2012 om 00:41 heeft David Kastendick <[email protected]> het volgende geschreven:
    Re: Easier and better ways to solve current problems with Acrobat?
    created by David Kastendick in Acrobat Installation & Update Issues - View the full discussion
    The description of the issue you originally presented isn't something that I've seen happen to Acrobat when installed as a part of Creative Cloud.
    Could you provide a specific description of the behavior that occurs when you launch Acrobat XI now?
    Thanks,
    David
    Please note that the Adobe Forums do not accept email attachments. If you want to embed a screen image in your message please visit the thread in the forum to embed the image at http://forums.adobe.com/message/4902597#4902597
    Replies to this message go to everyone subscribed to this thread, not directly to the person who posted the message. To post a reply, either reply to this email or visit the message page: http://forums.adobe.com/message/4902597#4902597
    To unsubscribe from this thread, please visit the message page at http://forums.adobe.com/message/4902597#4902597. In the Actions box on the right, click the Stop Email Notifications link.
    Start a new discussion in Acrobat Installation & Update Issues by email or at Adobe Community
    For more information about maintaining your forum email notifications please go to http://forums.adobe.com/message/2936746#2936746.

  • Exist an app to watch the system logs in a better way? More organize?

    HI,
         Every time that I present a portal issue I past hours verifing portal logs, etc to find the issues occurred..
    Exist an app or a way to watch the logs in a better way?
    Thanks!
    Carlos

    Hi,
    You can use log4j for logging. You can write your logs wherever you want and categorize it.
    You can view an example: http://nwturk.com/blog/2010/04/16/logging-using-log4j-in-java-applications/

  • Design biztalk application

    What are the best way to design biztalk application ?

    The best way to design BizTalk application (or any application) is to understand the requirement clearly and understand what BizTalk can provide to solve/fulfil the requirement. Its a big topic, here are some you have to consider..
    Keep it simple : Don't impose any design pattern for the sake of implementing a pattern. Try to find a solution which is simple to maintain.
    Keep operational support in mind: While designing a solution keep how this is going to be maintained/ supported during production. Thinking about the operational support up front is key to the success of BizTalk projects (again any project
    in general not just for BizTalk).
    Maintain Documentation: Document the requirement and proposed solution. try to document your work, which would help.
    Consider performance: Don't just implement the solution technically, consider about the performance. As questions like ..Do you really need BizTalk for your requirement? Do you really need Orchestration? etc..
    monitoring system: Consider about implement good monitoring system. Consider using SCOM/Openview/BizTalk360 for operational support and start designing your solution in line with this monitoring requirements.
    Release process: Have proper release process. Use different environment for development/build/test/integration/UAT and production.
    Project management methodologies: Use good project management methodologies like Lean, Agile etc
    Then there are standard best practices like project/solution structure, coding standards, etc..
    If this answers your question please mark it accordingly. If this post is helpful, please vote as helpful by clicking the upward arrow mark next to my reply.

Maybe you are looking for