Peer review please

I have a working project (attached), but I'd like any suggestions on how I might do it better.
I have tried to keep to good object-oriented design principles such as 'Single Responsibility' and 'Encapsulation', but I'm always keen to do better.
Thanks
Mark
N.B. Doesn't allow Zip files, so you'll need to rename the attached '.doc' file to '.zip' before unzipping

Hi Mark,
I think I have 3 improvements for you:
1. The time you print,is a calculated time, not the actual time when the printing occurs. I mean: You create a Calendar instance when you start your program, and then add 300000 ms (= 5 minutes in ms precision) every time the loop is executed. If for some reason, there is some delay somewhere, you will not easily notice, because your program prints what it calculated as the current time, which is not necessarily the current time.
What I did in my solution, was creating a new Calendar instance every time I need to print the current time, and then get the time from this instance.
When I made my 1st solution to this homework, using Threads, I used a sleep for 5 minutes, expecting that I would receive a printout every 5 minutes. Running this program for an entire night, I noticed that my printouts showed a few seconds past the 5 minutes. I guess this was caused by the time the statements were using every during every loop. Imagine the error when the program would be running for weeks, or even months. If I would have printed a calculated time, I would probably not have noticed this error.
Bottom line of this improvement: I think it is better to print the contents of the system clock, rather than calculating what you think is the time.
2. When calculating the start time for your 5 minute Timer, yous use only second precision. After that, you use millisecond precision to calculate the next 5 minute time. What you don't take into account is that your startCalendar also has a millisecond field. Ideally, this has the value 0, but in the worst case, it has the value 999, causing your start time to be 1 second too late.
My solution for this homework uses the epoch value of the current time (the milliseconds since midnight of jan 1, 1970) to calculate the start time. You can read this value from a Calendar instance using the method getTimeInMillis().
The algorithm I use:
- Divide the current epoch value by 300000 (= 5 minutes).
- Increase the result by 1, and multiply again with 300000. This gives me the epoch value for the next 5 minute period, with millisecond precision.
- The difference between this calculated epoch, and the current epoch, is the number of milliseconds delay I need to be (almost) exactly at the next multiple of 5 minutes.
- Finally, I use the method scheduleAtFixedRate(task, initialDelay, 300000), whereas you use scheduleAtFixedRate(task, startDate, 300000)
I used the same procedure to calculate the start time of the 30 second intervals during the uneven 5minute periods. I ran this program for more then a day, and it always printed exactly at multiples of 5 minutes or 30 seconds (printing the system clock, not a calculated value :-) )
As a test, I also printed the delay that I calculated at the start of the 30 second task. It appeared that the delay that was calculated, was always around 29960 milliseconds (+/- 10). Therefore, I believe that my printouts are made with a millisecond value close to 0, every time.
Bottom line of this remark: Using epoch to calculate the start time is more accurate than making calculations with minute and second  values.
3. In the method startReading in class Homework1, you trust that you receive the method call at an exact multiple of 5 minutes. If for some reason, the method was received with a delay, all your 30 second printouts will suffer from this delay. If on the other hand you calculate the delay until the next multiple of 30 seconds (same calculation as in point 2, but divide / multiply by 30000 instead of 300000°) then the first 30 second printout will suffer from the delay, but all other printouts will come (almost) at multiples of 30 seconds with millisecond precision. I believe this makes the solution a bit more robust.
Bottom line of this remark: Never trust that you get what you expect, always verify what you get.

Similar Messages

  • Technical Specification Peer Review Document

    Hi Team
    right now i am working in a implementation project where PI system is a middleware system. here i am developing several abap related and PI related objects for that i have developed some Techincal specifications and now my requirement is to do the technical specification peer review. so I want to know more details about technical specification peer review document. Please tell me what is technical specification peer review document and why is used in detail. if possible please provide me the sample technical  specification peer review document for my reference. i request you to please explain me more details about the technical specification peer review document because i am having much knowledge and now there is a requirement for me to do technical specification peer review and update in the template, so please do provide me the sample techincal specification peer review template for my better understanding. Thanks in advance.
    Regards
    Raj

    Hi Raj,
    I never com across Technical Specification peer review document, We develop TS for every interface which covers
    1)Bussiness reuirement
    2)Trchnical Description in deatil
    3)Bussiness Flow
    4)Source and Tget data fromats description
    5)Mapping Logic
    6)Which adapters are you going to use,ad you need to specify all obejcts required for this interface/developed for this interface
    whick convers SLD,ESR,ID ...
    fter completion of evry interface we updates the all deatils in TS,then we need to review the same TS.if anything misses of we need to document the same.May be you need to develop one template for to note down all review comments...
    Regards,
    Raj

  • Need of peer review software (in research)

    Hej (Swedish for Hi),
    I have submitted this question to the Leopard forum, but if any administrator thinks it is more suitable in another Mac Forum, please feel free to move my post.
    NEED OF SOFTWARE
    Most of the times when I submit a manuscript to a scientific journal, that journal will ask me to supply the names, addresses and email addresses of 3-4 potential peer reviewers (they will scrutinize my paper and judge its quality). I do this over and over again. Sometimes a manuscript is rejected and I am quite convinced I know who rejected the paper (although peer review is anonymous), and I might not want to recommend that person again for the very same manuscript. Sometimes I have recommended a person as a peer reviewer several times within the last months, and want to recommend someone else.
    It could also be nice to have some statistics of how many times a certain person has been recommended, and for what journal. Of course this could probably be done in Excel, but perhaps there is some nice Mac-program for this (otherwise, is anyone interrested in writing one...?)
    I am looking for a software that could handle the following:
    name of the reviewer
    current email
    current address
    current institution
    reasons for choosing him/her as a peer reviewer
    Last time he was recommended
    Number of times he/she has been recommended.
    A list of all journals, dates and for what papers he has been recommended
    The outcome of each submission when he/she was recommended
    How would you have solved this?
    Best regards, Jonas Ludvigsson
    (doing research on celiac disease, and epidemiology in general)

    Howdy Jonas (Texas for hej),
    It sounds like you are looking for a simple database application. [Bento|http://store.apple.com/us/product/TW345LL/A] would probably be able to do everything you need. It is made by FileMaker.
    Best of luck.

  • How to use the LAN NetStream for peer transmission, please help, write a sample code

    How to use the LAN NetStream for peer transmission, please help, write a sample code

    No reply, I reply, Oh

  • About documents in the peer review

    1. What are the documents involved in the peer review of the object?
    2. is there anything called quality check list using when we are doing peer review?
    3. what is the meaning of quality check list, what do u do with the quality check list?

    Do check the following things...
    1) There are coding standards in every project. Try to check all the coding standards in the code.
    2) see that no hard coding is done in the code.
    3)Pls refer to an existing transaction code if you are making a module pool program.
    4) Always test the changes.
    5) If there are If & Else in program, make sure that you simulate conditions so that each line of code is executed at least once for testing.
    6) While writing selects try to see if indexes can be used
    7)Quality checklist generally means following the standards as laid out by the client.
    do an extended code review and try to remove as much extra things as possible.
    Reward if useful,
    Cheers,
    Sharadendu

  • Peer reviews,coding standards and audit norms

    hi,
    what is meant by peer reviews, coding standards and audit norms in development project of ABAP.
    regds:
    balakrishna.

    Hi Bala,
    Peer review: The code which is written by the developer will be cross checked by one of the team member if the code fulfills the technical spec or not.
    Coding Standards: In a project the client and the software service provider will have an understanding regarding naming convention of all variables, constants, internal table, select-options, etc.
    Example: if it is a select-options the field should be named with the first letter S_ then you will write S_Matnr, and for variables you have to follow V_ then V_maktx.
    Audit norms: Audit norms will depend on the organization so it does not have any standard answer.
    Regards,
    Lakshmikanth

  • I am not able to sign in with my exisiting Apple id, every time it is asking for review, please help me

    i am not able to sign in with my exisiting Apple id, every time it is asking for review, please help me

    Use this link to Contact iTunes Customer Service
    Apple  Support  iTunes Store  Contact Us

  • Money under review please help

    hello, the 17th june i sold 3 digital items for 25usd , 25usd and 15usd. everything went well and he got what he wanted. the thing is the money has been under review for a while and i really need to buy something before august 1st. about 2 weeks before i sold these items, i sold one to another guy who sent me 10usd and the money was put under review for only 4 days but now this one has been under review for a while. Also,  i am a very new seller so thats why all my transactions are put under review. i verified my paypal today with my bank account linked but i still didnt get the money. is there a way i could get it faster? please help and sorry for bad spelling im french canadian.

    Hello everyone, I have Business Account at PayPal and i was accepting payments for our business. Before 2 months my accounts was gone for limited and PayPal asked to provide documents to restore. I had provided all required documents to restore account. After 7 days i got mail from PayPal at 6/9/2015 4:34 PM that Dear (name), Important information: We regret to inform you that we're initiating the closure of your PayPal account. This measure is necessary to protect us from potential financial losses. Your right to appeal: We always perform a thorough investigation before deciding to initiate the closure of an account. We appreciate that from time to time misunderstandings can happen. To appeal our decision log in to your PayPal account at www.paypal.co.uk and click 'Contact' at the bottom of any PayPal page. This decision means we need to oversee the appropriate movement of any money currently in your account. A gradual approach to account closure allows us to part ways, while considering any liabilities that may arise. Our aim is to review any valid buyer claims lodged against you. We need to allow enough time for claims to be filed as these can take several months to be reported and resolved. How and when will my account balance be released? 1. We'll hold any money currently in your account in accordance with section 2 below. We do this because it provides sufficient time for most claims, such as chargebacks, to be filed by other parties. These claims can result in financial loss. If your account balance is below zero, you'll have to settle the amount owing on your account to avoid further action. 2. Our first review at 30 days from the date of this email will calculate our exposure and we'll release any excess funds to you at that time for withdrawal. We'll communicate this to you at the time. This review can result in 3 different outcomes as detailed in subsections 2(1)-(3) below. We'll always communicate the outcome of our reviews to you. 2.1. We'll release your entire remaining balance to you for withdrawal. Note: If you choose not to withdraw the money at that point we reserve the right to recoup any money at the next review; or 2.2. We'll release a part of your remaining balance to you. If so we'll inform you about how much money can be withdrawn. We'll then conduct another review 30 days later that will repeat the process detailed under section 2; or 2.3. We won't release any funds to you if we deem our exposure to be greater than or equal to your available balance. Your account may be reviewed up to 5 times; at 30 day intervals until day 180 from the date of this email. If any money remains in your account at day 180, it will be made available for withdrawal at that point. When we part ways with merchants, where insolvency or administration is in place, or in some specific business models, we will usually hold funds up to 180 days. Accounts with a balance owing to PayPal: If your account shows an amount owing to us, you need to add funds to make sure that the balance returns to zero. Note: We reserve the right to recover the amount by legal means. A copy of our User Agreement can be found by clicking 'Legal' at the bottom of any PayPal page and then click 'User Agreement for PayPal Service'. Our right to close your PayPal account, and the retention of funds, are covered in our User Agreement under sections 10.2 and 10.3. Yours sincerely, David PayPal Now this is near to complete 2nd month and PayPal had not released any balance even in the last mail they said they will release a part of my money every month. Here now PayPal held my 126400.00 USD. My complete business has been down. I had mail to PayPal that Please release at least 10% of my money every month so i can continue our business. But no reply. Please let us any way with we can get a small part of our money every month. Best Regards

  • EA6900 Review Please

    Some one please do a review of this router and we all know it is made by Belkin now. So far the reviews on Amazon have been bad.   

    Reviews posted on their own company site are usually made up.  Need to go to an independent site which is unbiased.

  • "Hot Folder to FTP" script review please

    I'm trying to make a folder on my Mac that is a "Hot Folder." I want this folder to have an action/script that as soon as it sees a new file added it will open Fetch and upload via mirror to an FTP folder.
    I was able to make the Fetch portion of the script without issue, but making the folder "Hot" is a bit more difficult for me. I tried to use some script from the sample script "add - new item alert" but have been unsuccessful. I'm hoping some of you Applescript pros can review this and tell me how to correct. Or perhaps you know of a better way to make this work with automator.
    SCRIPT:
    on adding folder items to this_folder after receiving added_items
    try
    tell application "Finder"
    --get the name of the folder
    set the folder_name to the name of this_folder
    end tell
    -- find out how many new items have been placed in the folder
    set the item_count to the number of items in the added_items
    --create the alert string
    if the item_count is greater than 1 then
    tell application "Fetch"
    activate
    make new transfer window at beginning with properties {hostname:"ftp.hostname.here", username:"myusername", password:"mypassword", initial folder:"/pub/pao/images/"}
    mirror alias "Macintosh HD:Users:Bill:Desktop:test:" to url "ftp://myusername:@ftp.hostname.here/pub/pao/images/" format Automatic without delete strays
    end tell
    end if
    end try
    end adding folder items to
    Thank you all!

    Well, the most obvious problem is:
    if the item_count is greater than 1 then
    If you drop a single file into the folder, nothing will happen. That's because item_count will be 1, not greater than 1.
    If you don't care about how many files were dropped (because Transmit's mirror function will just synchronize the differences, then omit this line altogether - the script won't fire unless at least one file was added.

  • Requesting peer review of coding technique.

    Hello, I'm curious if anyone here can review my flash to see
    if my coding techniques are proper.
    To start, here's the site:
    Example Site
    If you click on the top row of buttons corresponding to each
    section, you'll notice a slight transition before the section is
    loaded. Each section is a separate .swf file, which is loaded via
    actionscript to a MovieClipLoader. (See livedocs for the
    MovieClipLoader API reference)
    The transition animation is responsible for passing calls to
    the MovieClipLoader for loading/unloading movies, and does so
    during keyframes in the animation's timeline. For example, when a
    button is clicked, and "the curtain is down" the MovieClipLoader is
    unloaded, and then loaded with a different .swf.
    I don't have access to a screen reader to test how accessible
    the flash is. However, I have been told that accessibility
    standards suggest animations be hidden from a screen reader via the
    "wmode" property. Assuming the animation is disabled in the screen
    reader, will the transition animation still fire events it incurs
    on the timeline?
    Should I not control loading/unloading of movie clips on the
    timeline? I believe my technique is robust enough to work in a
    non-accessible environment. It locks input while the animation is
    playing, and ensures a small memory footprint by unloading unused
    .swf files. However, is it the right approach with accessibility in
    mind?
    Thanks for any input,
    -Jonathan

    it would look better if instead of a white dropdown covering
    the previous content and then a black dropup revealing the next
    content, you used a dropdown that changed the previous content to
    an alpha of 10% until the bottom is reached when the next content
    is loaded with an alpha of 10% and the dropup revealed the next
    content with 100%.

  • Database DAO - JDBC Query Class - Code review please

    I use the following class (Database.java) as a DAO for handling all database calls. The class works. You can use this if you're looking for a DAO solution (i.e. a way to query databases using connection pools / JNDI). I am looking for some suggestions on improving this class. Can you help? I.e. suggestions for improving SELECT speed, logic? The class is used by a moderately heavily used Web application (ca. 2000 - 3000 queries a day - so not too much) on a Sun Web Server system.
    This class had the following interfaces:
    getErrors() // for retrieving any errors that occurred during an query
    setSql() // one way to set the SQL that must be run
    setDbName() // one way to set the JNDI name of the database resource
    getInsertDelete() // run the INSERT/DELETE statement that was provided with setSql
    getInsertDelete(String givenSql, String givenDb) // run with provided sql and db
    getClobInsert(String givenSql, String givenDb, Hashtable clobHash, String identifierSql) // clobHash contains the column name and the value (which is a string over 4000 chars). Identifier SQL is the SQL for identifying the row, into which the Clob must be inserted. This interface is specific to Oracle.
    getSelect() // Query database with set SQL. Return as a vector of hashes so I can close connection.
    getSelect(String givenSql, String givenDb) // select with given sqlAnd here is the full class. I know, this is a weird post, but we don't really have a code review process here at work, and I don't have a specific problem. Just want some feedback concerning the way I query our databases. So, any tips or comments are welcome.
    package melib.network;
    import java.io.Writer;
    import java.io.StringReader;
    import java.io.IOException;
    import java.util.Vector;
    import java.util.Hashtable;
    import java.sql.Connection;
    import java.sql.Statement;
    import java.sql.ResultSet;
    import java.sql.ResultSetMetaData;
    import java.sql.Clob;
    import javax.sql.DataSource;
    import javax.naming.InitialContext;
    import melib.system.PropertiesReader; // This is just a simple class for pulling values from a .properties file
    * Manages database connections.
    * @author jetcat33
    * @version 2.0, 2006-07-09
    public class Database {
        protected String sql = "";
        protected String dbName = "";
        private StringBuffer errors = new StringBuffer();
        /** Creates a new instance of Database */
        public Database() {
         * Check completeness of data
         * for example to check if dbname given or
         * sql given or to make sure that yikes
         * used instead of sccweb in test conditions
        protected boolean checkData(){
            if(dbName.equals("") || sql.equals("")){
                Email.sendMail(PropertiesReader.getValue("statusEmail"),null,"MelibLibraryError","melib error: [Database]","No database selected for query (db: "+dbName+" or sql not included (sql: "+sql+")");
                setErrors("No database selected for query (db: "+dbName+" or sql not included (sql: "+sql+")");
                return false;
            }else{
                return true;
         * Sets and gets errors resulting from
         * exceptions - otherwise would have to
         * somehow include errors in the results
         * that are returned but that would include
         * other more complicated stuff.
        private void setErrors(String e){
            errors.append("\n"+e);
        public StringBuffer getErrors(){
           return errors;
         * Setter for the sql variable.
         * @param givenSql The sql required to process
        public void setSql(java.lang.String givenSql) {
            sql = givenSql;
         * Sets the dbName needed to commect
         * to the correct database.
         * @param givenDbName Name of the database - name and connections specified within this class
        public void setDbName(java.lang.String givenDbName) {
            dbName = givenDbName;
         * Processes Insert and Delete requests with given SQL and DB Name.
         * @param givenSql
         * @param givenDbName
         * @return String Number of rows affected
        public String getInsertDelete(String givenSql, String givenDbName){
            sql = givenSql;
            dbName = givenDbName;
            return getInsertDelete();
         * Takes care of insert, update and delete requests.
         * Must have set both dbName as well as the sql String.
         * Will return number of rows affected as String.
         * @return String Number of rows affected
         * @exception Exception
        public String getInsertDelete() {
            int returnValue = 0;
            if(checkData()){
                Connection conn = null;
                InitialContext initContext = null;
                DataSource source = null;
                Statement stmt = null;
                try{
                    // Get connection from configured pool
                    initContext = new InitialContext();
                    source = (DataSource) initContext.lookup("java:comp/env/jdbc/" + dbName);
                    conn = source.getConnection();
                    if(conn != null){
                        stmt = conn.createStatement();
                        returnValue = stmt.executeUpdate(sql);
                }catch (Exception e){
                    Email.sendMail(PropertiesReader.getValue("statusEmail"),null,"MelibLibraryError","melib error: [Database.getInsertDelete]","getInsertDelete Exception: "+e.toString()+"\nWith: "+sql);
                    setErrors(e.toString());
                }finally{
                    try{
                        stmt.close();
                    }catch(Exception e){
                        e.printStackTrace();
                    try{
                        conn.close();
                    }catch(Exception e){
                       e.printStackTrace();
                    try{
                        initContext.close();
                    }catch(Exception e){
                        e.printStackTrace();
            return returnValue+"";
         * Processes Insert requests for SQL containing CLOBS
         * @param givenSql
         * @param givenDbName
         * @param clobHash Contains column name of clob and clob text
         * @param identifierSql Contains SQL to identify the just entered SQL so the clobs can be filled in.
         * @return String Number of rows affected
        public String getClobInsert(String givenSql, String givenDbName, Hashtable clobHash, String identifierSql){
            sql = givenSql;
            dbName = givenDbName;
            String returnValue="";
            int rv = 0;
            if(checkData()){
                Connection conn = null;
                InitialContext initContext = null;
                DataSource source = null;
                Statement stmt = null;
                try{
                    // Get connection from configured pool
                    initContext = new InitialContext();
                    source = (DataSource) initContext.lookup("java:comp/env/jdbc/" + dbName);
                    conn = source.getConnection();
                    if(conn != null){
                        conn.setAutoCommit(false);
                        stmt = conn.createStatement();
                        rv = stmt.executeUpdate(sql); // write first time
                        // Now get and overwrite "EMPTY_CLOB()"
                        ResultSet lobDetails = stmt.executeQuery(identifierSql);
                        ResultSetMetaData rsmd = lobDetails.getMetaData();
                        if(lobDetails.next()){
                            for(int i = 1; i <= rsmd.getColumnCount(); i++){
                                if(clobHash.get(rsmd.getColumnName(i))!=null && !clobHash.get(rsmd.getColumnName(i)).equals("")){
                                    Clob theClob = lobDetails.getClob(i);
                                    Writer clobWriter = ((oracle.sql.CLOB)theClob).getCharacterOutputStream();
                                    StringReader clobReader = new StringReader((String) clobHash.get(rsmd.getColumnName(i)));
                                    char[] cbuffer = new char[30* 1024]; // Buffer to hold chunks of data to be written to Clob, the slob
                                    int nread = 0;
                                    try{
                                        while((nread=clobReader.read(cbuffer)) != -1){
                                            clobWriter.write(cbuffer,0,nread);
                                    }catch(IOException ioe){
                                       //System.out.println("E: clobWriter exception - " + ioe.toString());
                                    }finally{
                                        try{
                                            returnValue+=" Writing: "+rsmd.getColumnName(i);
                                            clobReader.close();
                                            clobWriter.close();
                                        }catch(IOException ioe2){
                                            //System.out.println("E: clobWriter close exception - " + ioe2.toString());
                        conn.commit();
                }catch (Exception e){
                    Email.sendMail(PropertiesReader.getValue("statusEmail"),null,"MelibLibraryError","melib error: [Database.getClobInsert]","getClobInsert Exception: "+e.toString()+"\nWith: "+sql+"\nAND\n"+identifierSql);
                    setErrors(e.toString());
                }finally{
                    try{
                        stmt.close();
                    }catch(Exception e){
                        e.printStackTrace();
                    try{
                        conn.close();
                    }catch(Exception e){
                       e.printStackTrace();
                    try{
                        initContext.close();
                    }catch(Exception e){
                        e.printStackTrace();
                returnValue=rv+" "+returnValue;
            return returnValue;
         * Takes care of Select statements.
         * Must have set both dbName as well as the sql String.
         * Will return a vector.
         * @return Vector of Hashes containing the Results of the query
         * @exception SQLException
         * @exception Exception
        public Vector getSelect(){
            Vector returnValue = new Vector();
            if(checkData()){
                Connection conn = null;
                InitialContext initContext = null;
                DataSource source = null;
                ResultSet result = null;
                ResultSetMetaData rsmd = null;
                Statement stmt = null;
                try{
                    // Get connection from configured pool
                    initContext = new InitialContext();
                    source = (DataSource) initContext.lookup("java:comp/env/jdbc/" + dbName);
                    conn = source.getConnection();
                    if(conn != null){
                        stmt = conn.createStatement();
                        result = stmt.executeQuery(sql);
                        rsmd = result.getMetaData();
                        while(result.next()){
                            Hashtable hash = new Hashtable();
                            for(int i = 1; i <= rsmd.getColumnCount(); i++){
                                if(result.getString(i) != null){
                                    hash.put(rsmd.getColumnName(i),result.getString(i));
                                }else{
                                    hash.put(rsmd.getColumnName(i),"");
                            returnValue.addElement(hash);
                }catch (Exception e){
                    Email.sendMail(PropertiesReader.getValue("statusEmail"),null,"MelibLibraryError","melib error: [Database.getSelect]","getSelect Exception: "+e.toString()+"\nWith: "+sql);
                    setErrors(e.toString());
                }finally{
                    try{
                        result.close();
                    }catch(Exception e){
                        e.printStackTrace();
                        setErrors(e.toString());
                    try{
                        stmt.close();
                    }catch(Exception e){
                        e.printStackTrace();
                        setErrors(e.toString());
                    try{
                        conn.close();
                    }catch(Exception e){
                       e.printStackTrace();
                       setErrors(e.toString());
                    try{
                        initContext.close();
                    }catch(Exception e){
                        e.printStackTrace();
                        setErrors(e.toString());
            return returnValue;
         * Takes care of Select statements with given SQL.
         * Must have set both dbName as well as the sql String.
         * Will return a vector.
         * @return Vector with Results of the query
         * @exception SQLException
         * @exception Exception
        public Vector getSelect(String givenSql, String givenDbName){
            sql = givenSql;
            dbName = givenDbName;
            return getSelect();
    }Thank you,
    dailysun

    too much code that's repeated. refactor all the code you have for closing resources into a utility class and simply call its methods.
    your dao creates the connection, so it can't participate in a transaction. if there are several daos that should be one unit of work, you can't manage it with this framework.
    transactions are under the control of a service layer. I think it's better to have the service object get the connection, pass it to all the DAOs needed for that unit of work, and then have the service close it.
    e-mailing errors? I don't like it. if you have 2-3K queries a day failing because the database you'll have 2-3K e-mails to delete. better to log messages. if you really want e-mail, you can have Log4J add an e-mail appender. at least that way it's configurable outside the code.
    CRUD operations without an UPDATE? You're missing something important.
    What if I don't want to get the database from a JNDI datasource? Now you can't use this DAO without an app server.
    Your error messages are less informative than a stack trace. Why not throw an exception with detailed info?
    have a look at Spring and how it handles persistence. if you insist on writing your own, might want to look at Spring. Rod Johnson has developed a much better, more general way to handle persistence.
    http://www.springframework.org
    You return a Vector of Hashtables for queries? Two old-school data structures. You understand the implication of choosing those, right? I'd recommend that you change that to a List of Maps. Let the concrete types be ArrayList and HashMap. Interfaces are preferred, because they let you change the implementation without affecting clients. Vector and Hashtable are synchronized by default; ArrayList and HashMap are not. Synchronization is thread safe but slower.
    I understand why you chose to return Vector, because you wanted something general that wouldn't force you to deal with object-relational mapping. This way you can just worry about ResultSetMetaData.
    A Vector of Hashtables is a row-based view of the ResultSet (one Hashtable per row). Sometimes a column based view can be more convenient. Then it's a Map of Lists.
    You gave it a good try, but I think there's a lot of room for improvement.
    %

  • WebPager Reviews Please

    Hi I already have program developed for charging of a electrical vehicle prototype using charger controller and communicating between the hardware and the PC through ethernet via cRIO and NI I/O modules. I want the program to be available on a remote handheld device (tablet/mobile). What is the best option among the three?
    1) LabVIEW Webpager
    2) RTI DDS Toolkit with RTI Connext or
    3) Data Dashboard
    I have 2 specific queries:
    a) Since Webpager seems to be the simplest solution, I want some reviews or feedback of it before I make a choice. 
    b) In the online tutorials for Data Dashboard, they tell us how to create a fresh program and implement of Dashboard. However my program doesn't have any shared variables except the already existing ones for the NI I/O modules, how do I deploy the indicators and controls on dashboard?

    What is the future of this application? You say this application supports a "prototype" electric vehicle. Will this application be evolving into a long term permanent solution for a production electric vehicle? The correct solution will vary significantly based on that answer.
    Mike...
    Certified Professional Instructor
    Certified LabVIEW Architect
    LabVIEW Champion
    "... after all, He's not a tame lion..."
    Be thinking ahead and mark your dance card for NI Week 2015 now: TS 6139 - Object Oriented First Steps

  • Zero-fingerprint deployment scenario - peer review invite

    School/College implementation with student BYO laptop concept.
    Packaging the vApps and securing the desired sandboxing is of course a part of the project as well as having expirydates.
    Delivery is another question: By website for download, using streaming features, delivery by common iFolder or whatever you might have found a solid solution ??
    And on top of the applications what about filesharing ? (iFolder) and printing ? (iPrint) or any other solutions.
    KR /Bjrn

    bkelsen,
    It appears that in the past few days you have not received a response to your
    posting. That concerns us, and has triggered this automated reply.
    Has your problem been resolved? If not, you might try one of the following options:
    - Visit http://support.novell.com and search the knowledgebase and/or check all
    the other self support options and support programs available.
    - You could also try posting your message again. Make sure it is posted in the
    correct newsgroup. (http://forums.novell.com)
    Be sure to read the forum FAQ about what to expect in the way of responses:
    http://forums.novell.com/faq.php
    If this is a reply to a duplicate posting, please ignore and accept our apologies
    and rest assured we will issue a stern reprimand to our posting bot.
    Good luck!
    Your Novell Product Support Forums Team
    http://forums.novell.com/

  • Carmenu problems/mini review - Please Nokia read!

    I have wrote a small (missing features/bugs) review of Carmenu here.
    I wish Nokia could comment; if we pay, can we ask for improvements?

    Hi there, the thread is back again.
    Updating some info for the developersfrom the other new thread, I have asked the moderator to delete if he/se wishes.
    My the tested configuration is:
    - Nokia N96: firmware 30.033
    - Carmenu (phone app) version 2.6
    - Car Kit (Ck-300) unit HF-21W: firmware v1.40
     Summary of current defects/bugs:
     - Slow load time: should be lowered to less than 2/3 seconds
    - bluetooth phone pairing needs shaping
    - Improve user interface design
    - Landscape version doesn’t work on “landscaped” phones
    - Portrait version clips the display when phone is “landscaped”
    - Add music playlists
    - Add album covers while playing music. Would be nice to have an track artwork browser
    - Phone ringtones appear in the music track list - possible to filter them out?
    - Missing fast forward/rewind functionality in music player
    - Doesn’t work with Maps 3 - Remote control commands are ignored in Maps 3
    - Missing Car Kit remote control input in Carmenu->Maps->address search; should be something like the method used to select contacts/tracks, to help input while driving
    - Add  TV and radio control inside Carmenu
    - Remote control doesn’t allow phone interaction outside of Carmenu, apart from phone call functions.
    - Music player should “remember” last played track, helping when entering/exiting car often. It could be within a reasonable timeout, say 30 minutes.
    - When exiting track playback, navigate back to the top menu accordingly, instead of jumping back to the top menu
    - Fair too long delay for total music track count; cache data somewhere?
    - Voice alerts are being clipped, particularly when the audio to be muted is not being played on car stereo's AUX input; big improvements needed here
    I also suggest Nokia developers to include, when releasing updates, a list that shows what defects have been fixed and the "known defects/bugs" in current release; this would help users to know exactly what to expect, before installing the update.

Maybe you are looking for

  • FM8 Quotes/apostrophes revisited

    I cannot use the '/" key with Smart Quotes on. I'm running FM 8.03 as part of the Tech Comm Suite under XP SP2. My maker.ini file reads <br /><br />; English curved quotes:<br />SmartQuotes=\xd4\xd5\xd2\xd3<br /><br />The version in Docs & Settings h

  • Please help me if u can??

    I have nokia 5300?and i downloaded a program in my phone the folder is ZIp??? And when i paste it in my phone it doesnt open?It says file format not supported? Can anyone pease help me?

  • XML stored as object relational fails

    We are looking at implementing a system to store Universal Business Language (UBL) 1.0 XML invoices in an XMLType column in 10g. I've registered all the requisite schemas (the UBL invoice comprises a rather complicated hierarchy of 19 individual name

  • Add several times a component

    I want to add many component on a JPanel. Many components have same text. For moment, I am adding all components with a For and the good text. I would like to create a fixed number of component with text I want, and add only these components. But I d

  • Academic Prices

    Good day I am interested in some Adobe product. I am an elected parent sitting on a High School Governing Board and school rep. on the School Board committee. I am not paid by the school/school board but part of a 20 members committee making decision