Synchronous IO best practice

I'm writing a simple interface to drive a fairly slow (~25MHz) SPI bus, and have a few questions about best practice.
The FPGA is the master device, which outputs a clock at something like 25MHz. On each rising clock edge, it drives data onto an output pin and latches data from an input pin. A trivial Verilog module would look something like this:
module main (
input clk, // 25MHz FPGA clock
// SPI pins
output spi_clk,
output reg spi_MOSI,
input spi_MISO );
// Generate SPI clock output
ODDR spi_clk_gen (
.Q(spi_clk),
.C(clk),
.CE(1'b1),
.S(1'b0),
.R(1'b0)
.D1(1'b1),
.D2(1'b0) );
reg data_out; // Data we want to drive onto the bus
reg data_in; // Data read from the bus
always @ (posedge clk) spi_MOSI <= data_out;
always @ (posedge clk) data_in <= spi_MISO;
endmodule
To ensure that this meets timing, I add the following constraints to my xdc file
create_generated_clock -name clk_spi -souce [get_pins spi_clk_gen/C] -dvide_by 1 [get_ports clk]
set_porperty IOB FORCE [get_ports {spi_MOSI spi_MISO}]
set_output_delay -clock [get_clocks clk_spi] -max t1 [get_ports spi_MOSI]
set_output_delay -clock [get_clocks clk_spi] -min t2 [get_ports spi_MOSI]
set_input_delay -clock [get_clocks clk_spi] -max t3 [get_ports spi_MISO]
set_input_delay -clock [get_clocks clk_spi] -min t4 [get_ports spi_MISO]
Where:
 - t1 is the SPI slave IC's minimum required setup time + the trace delay (from FPGA output pin to IC input pin) between spi_MOSI and spi_clk, defined in the sense that positive delay => spi_MOSI takes longer to reach the IC than spi_sclk.
 - t2 is the min trace delay - the SPI slave IC's minimum hold time
 - t3 is the sum of the max values of: the trace delay for spi_clk to reach the IC; the trace delay for spi_MISO to reach the FPGA; and, the IC's clk-output delay.
 -t4 same as 53, but sum of min values
My questions are:
1) From the constraints guide UG903, I take it that:
    (A) The reference point for the generated clock, clk_spi, is the output port of the ODDR block (not the FPGA output pin)
    (B) The set_output_delay/set_input_delay constraints relate the time the signal leaves/reaches the FPGA pin to the clock reference point.
So, this constraint doesn't take into account the delay between the ODDR output and the FPGA pin (e.g. the OBUF). Is that correct? Presumably, this delay is small (how small?) so I can comfortably ignore it given the relatively low clock speed I'm operating at. But, if I had brought the clock out through the FPGA fabric instead of using an ODDR (e.g. assign spi_clk = clk) this delay could be pretty large (again, how large typically for a 7-series FPGA?)?
2) I've seen adding the IOB FORCE constraint recommended in a few places. What is the point of this constraint? Presumably, keeping all the IO FFs in IOBs makes the timing very reproducible from build to build, but if the IO timings are all constrained isn't it better to let Vivado decide where to put them?
Thanks for your help!

Hi 
1. Look at the timing report.
2. Yes, if the design was properly constraint, you can leave for Vivado to decide. By default, Vivado also places these IO FFs into IOBs since Vivado placement and routing algorithms tries to meet timing.
Thanks,
Vinay

Similar Messages

  • SAP PI conceptual best practice for synchronous scenarios

    Hi,
    <br /><br />Apologies for the length of this post but I'm sure this is an area most of you have thought about in your journey with SAP PI.
    <br /><br />We have recently upgraded our SAP PI system from 7.0 to 7.1 and I'd like to document  best practice guidelines for our internal development team to follow.
    I'd be grateful for any feedback related to my thoughts below which may help to consolidate my knowledge to date.
    <br /><br />Prior to the upgrade we have implemented a number of synchronous and asynchronous scenarios using SAP PI as the hub at runtime using the Integration Directory configuration.
    No interfaces to date are exposes directly from our backend systems using transaction SOAMANAGER.
    <br /><br />Our asynchronous scenarios operate through the SAP PI hub at runtime which builds in resilience and harnesses the benefits of the queue-based approach.
    <br /><br />My queries relate to the implementation of synchronous scenarios where there is no mapping or routing requirement.  Perhaps it's best that I outline my experience/thoughts on the 3 options and summarise my queries/concerns that people may be able to advise upon afterwards.
    <br /><br />1) Use SAP PI Integration Directory.  I appreciate going through SAP PI at runtime is not necessary and adds latency to the process but the monitoring capability in transaction SXMB_MONI provide full access for audit purposes and we have implemented alerting running hourly so all process errors are raised and we handle accordingly.  In our SAP PI Production system we have a full record of sync messages recorded while these don't show in the backend system as we don't have propogation turned on.  When we first looked at this, the reduction in speed seemed to be outweighed by the quality of the monitoring/alerting given none of the processes are particularly intensive and don't require instant responses.  We have some inbound interfaces called by two sender systems so we have the overhead of maintaing the Integration Repository/Directory design/configuration twice for these systems but the nice thing is SXMB_MONI shows which system sent the message.  Extra work but seemingly for improved visibility of the process.  I'm not suggesting this is the correct long term approach but states where we are currently.
    <br /><br />2) Use the Advanced Adapter Engine.  I've heard mixed reviews about this functionaslity, there areh obvious improvements in speed by avoiding the ABAP stack on the SAP PI server at runtime, but some people have complained about the lack of SXMB_MONI support.  I don't know if this is still the case as we're at SAP PI 7.1 EHP1 but I plan to test and evaluate once Basis have set up the pre-requisite RFC etc. 
    <br /><br />3) Use the backend system's SOAP runtime and SOAMANAGER.  Using this option I can still model inbound interfaces in SAP PI but expose these using transaction SOAMANAGER in the backend ABAP system.  [I would have tested out the direct P2P connection option but our backend systems are still at Netweaver 7.0 and this option is not supported until 7.1 so that's out for now.]  The clear benefits of exposing the service directly from the backend system is obviously performance which in some of our planned processes would be desirable.  My understanding is that the logging/tracing options in SOAMANAGER have to be switched on while you investigate so there is no automatic recording of interface detail for retrospective review. 
    <br /><br />Queries:
    <br /><br />I have the feeling that there is no clear cut answer to which of the options you select from above but the decision should be based upon the requirements.
    <br /><br />I'm curious to understand SAPs intention with these options  -
    <br /><br />- For synchronous scenarios is it assumed that the client should always handle errors therefore the lack of monitoring should be less of a concern and option 3 desirable when no mapping/routing is required? 
    <br /><br />- Not only does option 3 offer the best performance, but the generated WSDL is ready once built for any further system to implement thereby offering the maximum benefit of SOA, therefore should we always use option 3 whenever possible?
    <br /><br />- Is it intended that the AAE runtime should be used when available but only for asynchronous scenarios or those requiring SAP PI functionality like mapping/routing otherwise customers should use option 3?  I accept there are some areas of functionality not yet supported with the AAE so that would be another factor.
    <br /><br />Thanks for any advice, it is much appreciated.
    <br /><br />Alan
    Edited by: Alan Cecchini on Aug 19, 2010 11:48 AM
    Edited by: Alan Cecchini on Aug 19, 2010 11:50 AM
    Edited by: Alan Cecchini on Aug 20, 2010 12:11 PM

    Hi Aaron,
    I was hoping for a better more concrete answer to my questions.
    I've had discussion with a number of experienced SAP developers and read many articles.
    There is no definitive paper that sets out the best approach here but I have gleaned the following key points:
    - Make interfaces asynchronous whenever possible to reduce system dependencies and improve the user experience (e.g. by eliminating wait times when they are not essential, such as by sending them an email with confirmation details rather than waiting for the server to respond)
    - It is the responsibility of the client to handle errors in synchronous scenarios hence monitoring lost through P-P services compared to the details information in transaction SXMB_MONI for PI services is not such a big issue.  You can always turn on monitoring in SOAMANAGER to trace errors if need be.
    - Choice of integration technique varies considerably by release level (for PI and Netweaver) so system landscape will be a significant factor.  For example, we have some systems on Netweaver 7.0 and other on 7.1.  As you need 7.1 for direction connection PI services we'd rather wait until all systems are at the higher level than have mixed usage in our landscape - it is already complex enough.
    - We've not tried the AAE option in a Production scenarios yet but this is only really important for high volume interfaces, something that is not a concern at the moment.  Obviously cumulative performance may be an issue in time so we plan to start looking at AAE soon.
    Hope these comments may be useful.
    Alan

  • Best practice for creating RFC destination entries for 3rd parties(Biztalk)

    Hi,
    We are on SAP ECC 6 and we have been creating multiple RFC destination entries for the external 3rd party applications such as Biz-talk and others using TCP/IP connection type and sharing the programid.
    The RFC connections with IDOC as data flow have been made using Synchronous mode for time critical ones(few) and majority through asynchronous mode for others. The RFC destination entries have been created for many interfaces which have unique RFC destinations with its corresponding ports defined in SAP. 
    We have both inbound and outbound connectivity.with the large number of RFC destinations being added we wanted to review the same. We wanted to check with others who had encountered similar situation and were keen to learn their experiences.
    We also wanted to know if there are any best practices to optimise on number of RFC destinations.
    Here were a few suggestions we had in mind to tackle the same.
    1. Create unique RFC destinations for every port defined in SAP for external applications as Biztalk for as many connections. ( This would mean one for inbound, one for outbound)
    2. Create one single RFC destination entry for the external host/application and the external application receiving the idoc control record to interpret what action to perform at its end.
    3. Create RFC destinations based on the modules it links with such as materials management, sales and distribution, warehouse management. This would ensure we can limit the number of RFC to be created and make it simple to understand the flow of data.
    I have done checks on SAP best practices website, sap oss notes and help pages but could not get specific information I was after.
    I do understand we can have as unlimited number of RFC destinations and maximum connections using appropriate profile parameters for gateway, RFC, client connections, additional app servers.
    I would appreciate if you can suggest the best architecture or practice to achieve  RFC destinations in an optimized manner.
    Thanks in advance
    Sam

    Not easy to give a perfect answer
    1. Create unique RFC destinations for every port defined in SAP for external applications as Biztalk for as many connections. ( This would mean one for inbound, one for outbound)
    -> be careful if you have multi cllients ( for example in acceptance) RFC's are client independ but ports are not! you could run in to trouble
    2. Create one single RFC destination entry for the external host/application and the external application receiving the idoc control record to interpret what action to perform at its end.
    -> could be the best solution... its easier to create partner profiles and the control record will contain the correct partner.
    3. Create RFC destinations based on the modules it links with such as materials management, sales and distribution, warehouse management. This would ensure we can limit the number of RFC to be created and make it simple to understand the flow of data.
    -> consider this option 2.
    We send to you messagebroker with 1 RFC destination , sending multiple idoctypes, different partners , different ports.

  • Best Practice: A J2EE Blue-Print for a Typical Web App

    Consider a typical synchronous Struts-based Web application which does a simple DB search and post. What are some of the main patterns and components that should be used if following the �industry best practices�
    Does the following flow seem accurate?
    Strust Action creates a TransferObject , and passes it to a Business Delegate. Delegate finds the appropriate BusinessObject, the Business Object uses the Data Access Object�.the CRUD operation happens and the result is sent back to the Action in the same TransferObject.
    Which one of these components need an interface?
    What's the best way for this components to interact with each other (factory, etc.)?
    Message was edited by:
    kmkiani
    Message was edited by:
    kmkiani

    There are 3 tiers in a Java EE application. (Presentation, Business, Integration).
    The BusinessDelegate in this scenario would be a Presentation-tier business delegate. This guy would interact with a Session Facade who lives on the Business-tier. The SessionFacade is the abstraction on the Business-tier and the Business Delegate is the abstraction on the Presentation-tier. It is these guys that have direct communication. This design enables low coupling between the actual implementations of each area. If done properly, you could go from EJB to Web Service to POJO business models without ever having to change anything in the Presentation-tier.
    These object-oriented design patterns are primarily for Enterprise applications with extensive Quality-of-Service requirements.
    In your scenario, the Presentation-tier would contain a MVC-based web application, i.e. Struts. The business model and business/domain requirements would be implemented in the Business-tier.
    Presentation Tier - Struts Web Application
    Business Tier - (EJB | POJO | WEB SERVICES) Application
    Integration Tier - (Relational Database | File System | XML Database | EIS)

  • Best practice for OSB to OSB communication

    Cross posting this message:
    I am currently in a project where we have two OSB that have to communicate. The OSBs are located in different security zones ("internal" and "secure"). All communication on a network level must be initiated from the secure zone to the internal zone. The message flow should be initated from the internal zone to the secure zone. Ideally we should establish a tcp connection from the secure zone to the internal zone, and then use SOAP over HTTP on this pre-established connection. Is this at all possible?
    Our best approach now, is to establish a jms-queue in the internal zone and let both OSBs connect to this. All communication between the zone is then done over JMS. This is an approach that would work, but is it the only solution?
    Can the t3/t3s protocol be used to achieve our goal? I.e. To have synchronous commincation over a pre-established connection (that is established the in opposite direction of the communication)?
    Is there any other approach that might work?
    What is considered best practice for sending messages from a OSB to another OSB in a more secure zone?
    Edited by: hilmersen on 11.jun.2009 00:59

    Hi,
    In my experience in a live project, we have used secured communication (https) between internal service bus and DMZ/external service bus.
    We also used two way SSL with customers.
    The ports were also secured by firewall in between them.
    If you wish more details, please email [email protected]
    Ganapathi.V.Subramanian[VG]
    Sydney, Australia
    Edited by: Ganapathi.V.Subramanian[VG] on Aug 28, 2009 10:50 AM

  • Best Practice to Atomic Read and Write a Field In Database

    I am from Java Desktop Application background. May I know what is the best practice in J2EE, to atomic read and write a field in database. Currently, here is what I did
    // In Servlet.
    synchronized(private_static_final_object)
        int counter = read_counter_from_database();
        counter++;
        write_counter_back_to_database(counter);
    }However, I suspect the above method will work all the time.
    As my observation is that, if I have several web request at the same time, I am executing code within single instance of servlet, using different thread. The above method shall work, as different thread web request, are all referring to same "private_static_final_object"
    However, my guess is "single instance of servlet" is not guarantee. As after some time span, the previous instance of servlet may destroy, with another new instance of servlet being created.
    I also came across [http://code.google.com/appengine/docs/java/datastore/transactions.html|http://code.google.com/appengine/docs/java/datastore/transactions.html] in JDO. I am not sure whether they are going to solve the problem.
    // In Servlet.
    Transaction tx = pm.currentTransaction();
    tx.begin();
        int counter = read_counter_from_database();  // Line 1
        counter++;                                                  // Line 2
        write_counter_back_to_database(counter);    // Line 3
    tx.commit();Is the code guarantee only when Thread A finish execute Line 1 till Line 3 atomically, only Thread B can continue to execute Line 1 till Line 3 atomically?
    As I do not wish the following situation happen.
    (1) Thread A read counter from Database as 0
    (2) Thread A increment counter to 1
    (3) Thread B read counter from Database as 0
    (4) Thread A write counter as 1 to database
    (5) Thread B increment counter to 1
    (6) Thread B write counter as 1 to database
    What I wish is
    (1) Thread A read counter from Database as 0
    (2) Thread A increment counter to 1
    (4) Thread A write counter as 1 to database
    (3) Thread B read counter from Database as 1
    (5) Thread B increment counter to 2
    (6) Thread B write counter as 2 to database
    Thanks you.
    Edited by: yccheok on Oct 27, 2009 8:39 PM

    This is my understanding of the issue (you should research it further on you own to get a better understanding):
    I suggest you use local variables (ie, defined within a function), and keep away from static variables. Those local variables are thread safe. If you call functions within functions, its still thread safe. If you read or write to one record in a database using sql, its thread safe (you dont need a transaction). If you read/write to multiple tables and/or records, you probably need a transaction. Servlets are thread safe. You usually dont need the 'synchronized' word anywhere unless you have a function updating/reading a static variable and therefore want to ensure only one user is accessing the static varible at a time. Also do so if you are writing to some resource (such as a file, a variable in applicaton scope, session scope, or resource that everyone uses such as email server). You dont want more than one person at a time to write to it). Note the database is one of of those resources that is handled by transactions rather than the the synchronized keyword (the synchronized keyword is applied to your application only (not other applications that someone is running), whereas the transaction ensures all applications are locked out while you update those records in the database).
    By the way, if you have a static variable, you should have one and only one function (synchronized) that updates it that everyone uses. If you have more than one synchronized function, that updates it, its probably not thread safe.
    An example of a static variable you would use is a Datasource object (to obtain your database connections). You only need one connection pool in your application and you access it via the datasource variable.
    If you're unsure your code is thread safe, you can create two seperate threads that call the same block of functions repeatedly to ensure it works as expected.

  • Best practice for SCEP definition ADR?

    This is how I understand the best practice to be for configuring the SCEP definition ADR:
    Have synchronization run once per day during non peak hours 
    Configure the SCEP definition ADR to run after each synchronization rather than running in intervals such as every 6 hours
    Do not run synchronizations multiple times per day because it can add extra load on the server and cause the software update package version to increase too quickly and impact the definition deployment success rate
    Is this true?
    If so, then if Microsoft releases SCEP definitions 3 times per day and the synchronization runs only once per day, then obviously SCEP clients will not be able to download the latest, most current SCEP definition due to the fact that the sync process is
    what actually grabs the metadata from Microsoft's catalog. 
    Is it even possible to run multiple synchronizations per day? I am running SCCM 2012 R2 in my environment and I DO NOT see anywhere where one can configure multiple software update synchronizations to take place. It is possible from what I understand to
    do this using 3rd party tools, but I really do not want to go there. 
    Can someone please help me with this?
    As always, thanks so much. 

    Hi,
    That changed after Sp1 so it was true but now with sp1 and R2 you can schedule them three times a day. If you have infrastructure that can't handle that, that is another topic. But from Sp1 and further synchronizing the SUP three times a day and set the
    ADR to trigger after a synchronization is the best practice.
    "For performance reasons, in Configuration Manager with no Service Pack, do not schedule automatic deployment rules to deliver definition updates more than once each day. In Configuration Manager SP1, do not schedule automatic deployment rules to deliver
    definition updates more than three times a day."
    http://technet.microsoft.com/en-us/library/jj822983.aspx
    Regards,
    Jörgen
    -- My System Center blog ccmexec.com -- Twitter
    @ccmexec

  • Best practice for ConcurrentHashMap use?

    Hi All, would the following be considered "best practice", or is there a better way of doing the same thing? The requirement is to have a single unique "Handler" object for each Key:
    public class HandlerManager {
        private Object lock = new Object();
        private Map<Key,Handler> map = new ConcurrentHashMap<Key,Handler>();
        public Handler getHandler(Key key) {
            Handler handler = map.get(key);
            if (handler == null) {
                synchronized(lock) {
                    handler = map.get(key);
                    if (handler == null) {
                        handler = new Handler();
                        map.put(key, handler);
            return handler;
    }Clearly this is the old "double-checked-locking" pattern which didn't work until 1.5 and now only works with volatiles. I believe I will get away with it because I'm using a ConcurrentHashMap.
    Any opinions? is there a better pattern?
    Thanks,
    Huw

    My personal choice would be to use the reliable "single-checked-locking" pattern:
        public Handler getHandler(Key key) {
            synchronized(lock) {
                Handler handler = map.get(key);
                if (handler == null) {
                    handler = new Handler();
                    map.put(key, handler);
                return handler;
        }But I'm afraid the Politically Correct way of doing it nowadays looks as ugly as this:
    class HandlerManager {
        private Map<Key,Handler> map = new HashMap<Key,Handler>();
        private final Lock readLock;
        private final Lock writeLock;
        public HandlerManager() {
            ReadWriteLock lock = new ReentrantReadWriteLock();
            readLock = lock.readLock();
            writeLock = lock.writeLock();
        public Handler getHandler(Key key) {
            Handler handler = null;
            readLock.lock();
            try {
                handler = map.get(key);
            } finally {
                readLock.unlock();
            if (handler == null) {
                writeLock.lock();
                try {
                    handler = map.get(key);
                    if (handler == null) {
                        handler = new Handler();
                        map.put(key, handler);
                finally {
                    writeLock.unlock();
            return handler;
    }

  • Design Patterns/Best Practices etc...

    fellow WLI gurus,
    I am looking for design patterns/best practices especially in EAI / WLI.
    Books ? Links ?
    With patterns/best practices I mean f.i.
    * When to use asynchronous/synchronous application view calls
    * where to do validation (if your connecting 2 EIS, both EIS, only in WLI,
    * what if an EIS is unavailable? How to handle this in your workflow?
    * performance issues
    Anyone want to share his/her thoughts on this ?
    Kris

              Hi.
              I recently bought WROX Press book Professional J2EE EAI, which discusses Enterprise
              Integration. Maybe not on a Design Pattern-level (if there is one), but it gave
              me a good overview and helped me make some desig decisions. I´m not sure if its
              technical enough for those used to such decisions, but it proved useful to me.
              http://www.wrox.com/ACON11.asp?WROXEMPTOKEN=87620ZUwNF3Eaw3YLdhXRpuVzK&ISBN=186100544X
              HTH
              Oskar
              

  • PHP/MySQL Test/Production Server best practices

    Hello,
         I am currently learning PHP/MySql and have setup a test server to develop on and a production server to go live with. I wanted to know what are the best practices for synchronizing the test server with the production. Should I export the database from the test server and import it to the production server each time I make a change or is there better way to incrementally sync the databases. I am using Dreamweaver to design the web site.
    Thanks,
    Nick

    Thanks, but does this mean that after I go live I should make changes on the production database only and not use the development database, if say I need to add a new table or record(s)?
    Procedure
    1. Take production web site down
    2. Export/Save current database
    3. Make changes to production database
    4. Export/Save new database
    5. Bring production web site up
    Is this correct?

  • Best Practice for Enterprise Application Integration

    I would like to integrate a few corporate systems together by using Oracle Fusion Middleware. I suppose the integrated process is running in synchronous mode such that it also supports two phase commit.
    In BPEL Process manager, there is a tool called "WSIF" which seems to be relevant to my requirement. I would like to know which tools should be best for my integration project and any suggestion on implementation.
    Thanks in advance,
    Samuel Wai

    This has been answered repeatedly. WL allows you to cache JNDI context
              objects, ejb homes and remotes without any problems. (EJB remote interfaces
              must only be used by one thread at a time, but that requirement is provided
              by the EJB spec itself.)
              Peace,
              Cameron Purdy
              Tangosol, Inc.
              http://www.tangosol.com
              +1.617.623.5782
              WebLogic Consulting Available
              "Geordie" <[email protected]> wrote in message
              news:3af9579f$[email protected]..
              >
              > I'm wondering what the best practice is for Servlet EJB integration in
              terms of
              > caching the home and remote objects. My understanding is that the Home
              object
              > is threadsafe and could therefore be cached as an attribute of the
              Servlet. This
              > would remove the need for a JNDI lookup for each request. Similarly
              caching the
              > ProxyObject would yield further savings. However, I have noticed that
              most examples
              > don't use either of these practices. Why not?
              >
              > Thanks in advance,
              > Geordie
              

  • Best practices about JTables.

    Hi,
    I'm programming in Java since 5 months ago. Now I'm developing an application that uses tables to present information from a database. This is my first time handling tables in Java. I've read Sun's Swing tutorial about JTable, and several information on other websites, but they limit to table's syntax and not in best practices.
    So I decided what I think is a proper way to handle data from a table, but I'm not sure that is the best way.Let me tell you the general steps I'm going through:
    1) I query employee data from Java DB (using EclipseLink JPA), and load it in an ArrayList.
    2) I use this list to create the JTable, prior transformation to an Object[][] and feeding this into a custom TableModel.
    3) From now on, if I need to search an object on the table, I search it on the list and then with the resulting index, I get it from the table. This is possible because I keep the same row order on the table and on the list.
    4) If I need to insert an item on the table, I do it also on the list, and so forth if I'd need to remove or modify an element.
    Is the technique I'm using a best practice? I'm not sure that having to keep synchronized the table with the list is the better way to handle this, but I don't know how I'd deal just with the table, for instance to efficiently search an item or to sort the table, without doing that first on a list.
    Are there any best practices in dealing with tables?
    Thank you!
    Francisco.

    Hi Joachim,
    What I'm doing now is extending DefaultTableModel instead of implementing AbstractTableModel. This is to save implementing methods I don't need and because I inherit methods like addRow from DefaultTableModel. Let me paste the private class:
    protected class MyTableModel extends DefaultTableModel {
            private Object[][] datos;
            public MyTableModel(Object[][] datos, Object[] nombreColumnas) {
                super(datos, nombreColumnas);
                this.datos = datos;
            @Override
            public boolean isCellEditable(int fila, int columna) {
                return false;
            @Override
            public Class getColumnClass(int col) {
                return getValueAt(0, col).getClass();
        }What you are suggesting me, if I well understood, is to register MyTableModel as a ListSelectionListener, so changes on the List will be observed by the table? In that case, if I add, change or remove an element from the list, I could add, change or remove that element from the table.
    Another question: is it possible to only use the list to create the table, but then managing everything just with the table, without using a list?
    Thanks.
    Francisco.

  • How to establish the connection - Best Practice

    Following is my code for database connection
    import java.sql.Connection;
    import java.sql.DriverManager;
    import oracle.jdbc.driver.OracleDriver;
    public class DBConnect
         private static Connection connection = null;
         static
              try
                   DriverManager.registerDriver( new OracleDriver() );
                   String url = "jdbc:oracle:thin:@dbserver:1521:ORCL";
                   connection = DriverManager.getConnection( url, "user", "password" );
              catch ( Exception e )
         private DBConnect()
         public static synchronized Connection getConnection()
              return connection;
    }Tell me the Best Practice to establish the connection.
    Edited by: shashiwagh on Feb 1, 2010 11:25 AM
    Edited by: shashiwagh on Feb 1, 2010 11:26 AM

    First, handle your exceptions properly.
    Second, you should not normally create static database connections.
    Third, hardcoding connection data like that is not a good idea.

  • Simple HTTP Post Handler - Best Practice?

    I would like to create a fairly simple ASP.Net application that takes an XML record from an HTTP post request, submits it to a process that invokes a command line app that parses the XML file, takes the parsed XML file (as XML), and returns the result. 
    For now the process can be synchronous as the transform has to complete and there are no parallel activities that need to be performed.
    I'm not sure that writing an HTTP Handler is the way to go, but maybe I'm mistaken.  Plus there are no examples of doing that in Visual Studio 2013 using IIS 8.0 or 8.5 and I don't really understand the value of applying a file extension or processing
    an HTTP post to initiate the request, perhaps using a dedicated port.  I already have a class library for handling the process request.
    I'm also a little confused about reading the post request - it seems I can just do it during the page load and that I should be able to extract the first request form field - that of course means using a webform to process the request which seems to be the
    most straight-forward way to do this. So I'm looking for the best practice for fielding this kind of request.  My target server is Windows 2012, but I'm developing with VS 2013 and C# on Windows 7 using IIS Express and configuring IIS is confusing. 
    Overall it is a fairly simple app, but there are so many rich new features in VS 2013 (most of my work has been in VS 2005).  I also want to build a test app and am looking for the best way to do so, although I think I can build a simple client app
    to do that.  The business requirements will be to issue the post request from a MarkLogic xquery request which will take care of any JSON wrappers and balance between multiple Windows servers to handle the load.
    Thanks for any help with this!
    ~Tim

    Hi Tim,
    Thank you for posting in the MSDN forum.
    Actually this forum is to discuss the VS IDE, if this issue is related to web development, you could ask this question in the ASP.NET forum:
    http://forums.asp.net. If then, you could get an answer more quickly and professional. Thanks for your cooperation.
    Best Regards,
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Mobile App Best Practice When Using SQLite Database

    Hello,
    I have a mobile app that has several views.
    Each view calls a different method of a Database custom class that basically returns the array from a synchronous execute call.
    So, each view has a creationComplete handler in which I have something like this:
    var db:Database=new Database();
    var connectResponse:Object=db.connect('path-to-database');
    if(connectResponse.allOK)//allOK is true if connection was succesful
       //Do stuff with data
    else
       //Present error notice
    However this seems reduntant. Is it OK to do this once (connect the the database) in the Main Application file?
    The do something like FlexGlobals.topLevelApplication.db?
    And even generally speaking, constants and other things that I would need throughout the app, can be placed in the main app? As a best practice, not technically as technically it is possible.
    Thank you.

    no, I only connect it once
    I figured I wanted several views to use it so made it static and singleton as I only have 1 database
    I actually use synchronous calls but there is a sync with remote mysql database function, hence the eventdispatcher
    ... although I am thinking it might be better to use Async and dispatch a custom event and have the relative views subscribe

Maybe you are looking for

  • Can you have two iPods on the same account

    I have an Itouch and an old classic that I want to load different music on.  Can I have two ipods on the same account?  Thanks

  • Using Aperture on 2 networked MACs (Macbook and Mac Pro)

    Hope someone can help answer any of the 3 questions we have on Aperture: We have Aperture on the MAC Pro. Now I am hoping to be able to do some work flow stuff on pictures in the library on the MAC Pro HDD. The Macbook connects over wifi (could easil

  • How to get the user of current session in EBS

    Hi everyone, I create a new form in EBS 11. I want to get user ID (or userName) of user who log in the current session of application for inserting into CREATE_BY field of table in database. How have i to get it thanks you and best regards

  • My files are a mess - how can I start over in iTunes?

    Over the years, my music files have become scattered all over between different locations on my internal drive and various externals. I have tons of duplicates, lost files, and it's just a general mess. I would like to do a search for all my music fi

  • IPad Photo

    I have updated my iPad with iOS5 from iTune 10.5 on MacBook OS X V10.5.8. (iPhoto'08) I supposed to classify my photos with "place" on iPad, but there is no options there. I have checked on Apple.com about photo on iPad with iOS5. They mention about