Design Patterns for java swing application front a J2EE server

Hi,
i dont nkow that i stay in the correct forum. I am development a java swing client application, no web, and i dont know that if there are any patterns for a client of this type.
I have readed http://java.sun.com/blueprints/corej2eepatterns/Patterns/index.html
but after of Buissnes Delegate pattern, the others one, over ejb tier, are applicated only for web clients, using servlets and jsp pages.
If i have a swing client application, what patterns i must folow for implement the client logic of my swing application??
thanks

MVC pattern is one of the most used
http://en.wikipedia.org/wiki/MVC
http://csis.pace.edu/~bergin/mvc/mvcgui.html
...

Similar Messages

  • Accelarate the Linux ATI Graphics card  for java Swing application

    Hi All,
    I am using a ATI Radeon 9550 Graphic card in LFS (Linux from the scratch) environment. I want to enable the OpenGL-based pipeline for Java Swing application. I tried the -Dsun.java2d.opengl=true . But the Java swing application getting very slow.
    How to overcome this problem?
    Any one give the procedure to Accelerate ATI graphics card for Java Swing Application
    How to verify Java swing use ATI graphics card ?
    Thanks in advance..
    Prabhu.S

    Hi All,
    I am using a ATI Radeon 9550 Graphic card in LFS (Linux from the scratch) environment. I want to enable the OpenGL-based pipeline for Java Swing application. I tried the -Dsun.java2d.opengl=true . But the Java swing application getting very slow.
    How to overcome this problem?
    Any one give the procedure to Accelerate ATI graphics card for Java Swing Application
    How to verify Java swing use ATI graphics card ?
    Thanks in advance..
    Prabhu.S

  • How to setup JAWS for Java Swing applications

    Hello All,
    I am having one swing application and need to test with JAWS.Could you please let me know the configuration steps.I tried with the following steps and it is not working properly.
    1. Install JDK1.5.0_08
    2. Install JAWS 7.0
    3. Install SUN accessbridge-2_0_1
    4. Copied access-bridge, jaccess-1_4 and accessibility.properties to jre\lib\ext
    it is not identifying even buttons also.
    Thanks & Regards,
    Gana

    Hello there,
    Gana, Ana
    I have the same problem
    1. Install JDK1.5.0_08
    2. Install JAWS 7.0
    3. Install SUN accessbridge-2_0_1
    4. Copied access-bridge, jaccess-1_4 and accessibility.properties to jre\lib\ext
    and nothing

  • Is there a forum for Java GUI Application Design?

    Hi all,
    I've used this forum a lot and found a lot of help on it for Swing usage specifics. However, whenever I ask a question about broader design or architecture of a full Swing app I get little or no response. Sadly I'm no stranger to "view 50, replies 0" :o(
    Either I'm asking stupid questions or I'm asking the in the wrong forum - does anyone know of a good place to ask about design/best practices for Java, GUI applications? I've seen some of the "programmer"/"developer" groups on Google Groups.
    Many thanks.
    Yours, hoping for at least one reply,
    Chris

    You're right, I typed that wrong. The method signature should be addDataChangeListener(DataChangeListener lis, DataChangeType type)
    When a component registers itself as a change listener, say it wants to know whenever an object of type Foo is changed, it calls DataChangeType.addDataChangeListener(this, DataChangeType.FOO). (the Enum elements coorespond to the objects we want to listen for) Then it implements the dataChanged(DataChangeType type, Object obj) method that will be called by the controller when objects of type Foo are changed. (obviously this is an interface) Whenever a component updates an object of type Foo, it calls DataChangeControl.dataChanged(DataChangeType.FOO, theFooObject), and then the controller will notify all listeners who are interested in Foo objects changing.
    The DataChangeControl maintains a hashmap of <DataChangeType, List < DataChangeListener> >. So when a new listener is added, it checks the type to see if a list is already keyed to that object type in the hashmap. If so it adds the listener to that list, if not it creates a new list in the hashmap with the type as the key. That way when an object is changed, it notifies only those listeners who are registered to listen to that type of object being changed. Hopefully that makes sense.

  • Does any body have any design patterns of JSF Web Application Developping?

    Can any one answer me some questions?
    #1.I am an amatuar of people who develop Web Application.For some reason,We choose the JSF to develop our item.through some introduction,I know the UI component of JSF is resided in Server side,is it right?but I am a little confused that:if there are many users who are exploring our jsf website.(to simplify my question,image I had just one web page and just one button)How many UI components(buttons) will be there?How it(they?) works?
    #2.Does any body have the success experience (for example design pattern)to develop web applications?if We just concern about the Add,Delete,Modify,Query operations of some data.
    I just do my job according to my feeling.
    I will give every page a pagebean(backing bean),and I am not sure how to combine the business data with the pagebean.some one suggested that I should use delegate pattern to separate my business log and page logic.But I am still confused by following things:
    #2.1 does JSF have the same ability to help us construct the model dialog just like swing to
    help us control the operation flow?
    #2.2 If there is not,Does the following way work?I put every tabledata's property as corresponed component.if user choosed the row in the table,My Listener will syncronize the row data to the components.But
    #2.2.1 if JSF has the components according to the web users' number,how can My Listener tell which component should be update?Should I maintain the map?
    #2.2.2 If the problem I imaged above is false,Does any body can tell me how to custom      the ListDataModel,so I can use it like Swing?because now I can just use some view data to insert into ListDataModel,but after some selection operation,my business object must be find according to the selected data,it is not an interesting job!
         I am waiting for your advice!

    Ok I'll try to explain Step by step please correct me if I make any mistake because I have not played much with shared variables.
    To create a shared variable to an RT target go to the target if tou have already otherwise add an RT target by right clicking the Project>>Add targets and Devices
    Then in the target Right clikc and select the variable as shown below.
    Then once the Shared variable settings window opens Enter a variable name and then Select the type "Network Published"
    In the right side you can select the data type for the shared variable and even you can choose your custome controls.
    After selecting the data type go for the Network and select buffering if required else leave it if you are planning to use the variable just for display purpose.
    Then you can enable the RT FIFO if required (Not able to explain how it works and why it is used).
    Then after completing the Shared variable setup you can access the variable in the VI in both the Host and the RT.
    You can bind the variable to a control so that if any data from the RT is coming you can read the data from that control.
    Once you have placed your shared variable in the BD you can change the access typr to read or write depending on your need.
    This might not explain the complete shared variable concept but I believe that this would defenelty give you a kick off to start using the shared variable. Please correct or add more comments if anybody know better.
    Good luck.
    The best solution is the one you find it by yourself

  • Book Recommendation for Building Swing Applications

    I'm looking for recommendations on books for building swing applications from the ground up.
    I'm not a strong GUI developer. 95% of my experience has been strictly on back end development in many other languages. What little GUI experience I have has been with C++ (years ago) and most recently with HTML.
    I know what I want to develop, and even have the GUI design for my application drawn out. I just need a good book that can walk me through developing the interface in Java.
    I already have several books on Java. But, I find them somewhat limiting because they don't help me build the app from the ground up.
    Yes, I've tried the online book on the Sun site, "The Jfc Swing Tutorial: Guide to Constructing Gui's".
    Please offer some recommendations and reasons on why you like the book.
    Thanks.

    A few comments to that ....
    the first thing is understanding the LayoutManagers, that are available.
    I will give you a short guideline where they are usefull:
    FlowLayout - usefull for JLabel-JTextField combinations or several JButtons
    BorderLayout - usefull for the structure of basic containers
    CardLayout - usefull for every area of the screen, where you want to appear different panels
    GridLayout - usefull for a group of same-sized components laid out in a grid
    GridBagLayout - usefull for a group of components, that have different sizes, very flexible
    JTabbedPane - a special container, that is similar to CardLayout but with visible tabs to switch panels
    Normally you can say "I want that group at the bottom of the frame, that other group at its left side, that toolbar at its top" - if you can say so - that shouts for BorderLayout. If you can say "in this area I want to use several panels" that means CardLayout or a JTabbedPane.
    You see, if you have an idea, what the LayoutManagers do, you know exactly which area needs what Layout - so you have a guideline, which LayoutManager to use in that panel.
    To make an example:
    You want 3 buttons centered at the bottom of a frame - this 3 buttoms should be of that size, that is needed by the button texts. So, what to do:
    1. create a JPanel with FlowLayout
    2. create the buttons and add it to that JPanel
    3. create another JPanel with BorderLayout
    4. add that first JPanel to the second JPanel at BorderLayout.CENTER
    5. add this Panel to the ContentPane of the frame at BorderLayout.SOUTH
    that is a simple panel in panel construct - placing 3 buttons centered at the bottom of the frame. You have to play with that different LayoutManagers a little bit - the way you stick one panel in another changes the look of the GUI - if you know, how it changes (by playing with the examples of the tutorial), you will have that "from the ground"-experience, you are looking for - believe me.
    greetings Marsian

  • Certificate support in Java Swing application

    Hi There,
    I am new to this Certificate thing and running into issues! Would appreciate for all the help and please ignore for any stupid questions.
    Here is my scenario.
    1. I do have a client server application and client is a java swing application which connects to a Server application (Using Jetty 4.2.22 as embedded server)
    2. Initially, it had a self signed certificate but goal is to support third party certificate (i.e import in the server and then show warning to the client during login)
    If somebody has already done this or point me to some example (using Jetty APIs) that would be great help. If not, here is what I am trying to do and some questions.
    1. I tried to get some free SSL certificate from the web and imported into the server's KeyStore.
    If I do a list from the server using Keystore, this is what it looks like
    keytool -list -keystore /tmp/keystore -storepass genview
    Keystore type: JKS
    Keystore provider: SUN
    Your keystore contains 2 entries
    self, Dec 3, 2008, PrivateKeyEntry,
    Certificate fingerprint (MD5): 0D:58:E8:77:89:09:F8:2B:37:64:37:D5:03:AD:C9:0B
    rapid, Jan 6, 2009, trustedCertEntry,
    Certificate fingerprint (MD5): 64:9C:EF:2E:44:FC:C6:8F:52:07:D0:51:73:8F:CB:3
    QUESTION 1 : why the third party certificate's entry as "trustedCertEntry"? Is it always like this? Do I need to have only one certificate at a time? (If so, just remove the self signed and have 3rd party one)
    My Jetty server comes up but when I connect from Client Swing App, the "getServerCertificates()" method only returns one entry i.e self signed one but not the third party one.
    I am using like this
    URL url = new URL("https://127.0.0.1:port");
    HttpsURLConnection conn = (HttpsURLConnection) url.openConnection();
    conn.connect();
    Certificate[] certs = conn.getServerCertificates();
    Is not this API supposed to return all the server's certificate?
    Please guide me or instruct me what to do.
    Thanks,
    CRB

    Crossposted and answered.

  • Unicode characters with accents won't display in Java Swing applications

    I'm using FreeMind (a Java Swing application) and I need to enter classical Greek characters with accent marks. When I type an accented Greek character, FreeMind displays the unaccented character. However, I can type the accented character in MS Word, then copy and paste into FreeMind, the accented character appears.
    One of the FreeMind developers indicated this was a Java Swing issue, not FreeMind, and suggested I test with another Swing application. So, I installed jEdit and got exactly the same results. I can paste an accented character into jEdit, but I cannot type it in directly.
    I'm using Windows Vista with Java 6 Update 22 (build 1.6.0_22-b04). I also tested on a XP Pro box with Java 1.6.0_18-b07 and got the same result.
    One other note: A couple days ago, I was able to type accented Greek characters into FreeMind. But it only worked for a couple days and then the behavior reverted to unaccented characters. It is possible, but I don't recall specifically, that I updated Java during the time and that may indicate a bug in one version of Java but not another.
    Any assistance or guidance would be greatly appreciated!
    Darin

    Walter,
    The link you provided does not appear to describe the Greek Polytonic keyboard. (The page also describes using the "Option" key as the dead key. There is no "Option" key on my keyboard. I'm using a Sony VGN-NS140E purchased in Chicago, i.e. standard physical US keyboard.)
    Please see http://darindavis.net/languages/keyboard_Greek.pdf for a detailed description of how to use the Greek (Polytonic) keyboard in Windows to produce a complete set of accented classical Greek characters. This method works in MS Word and Notepad. I enabled the Greek (Polytonic) keyboard with:
    Windows (Vista) Start > Control Panel > Regional and Language Options > Change Keyboards > General > Add > Greek (Greece) > Greek Polytonic
    A test that will demonstrate whether you can replicate the error is to do the following in both MS Word (or Notepad) and jEdit (or FreeMind):
    1. Enable the Greek Polytonic keyboard
    2. Type "\" then "e" which should produce an epsilon with smooth breathing and grave accent (ἒ)
    When I do this in MS Word or Notepad, I see the epsilon with smooth breathing and grave accent. When I do this in jEdit and FreeMind, I only see an epsilon.
    I recorded a screencast to illustrate the problem: http://www.screencast.com/t/TRKkKQrCgbN
    Actually, this problem is transient. Sometimes FreeMind or jEdit will display accented characters, other times it won't. Ironically, the first time I recorded the above referenced screencast, a few characters in jEdit did appear with accents. A couple minutes later, I re-recorded the screencast and as you can see jEdit did not display the accents. Between the two recordings I literally did nothing other than stop the Jing recording and start a new one. There is another variable at play here and I can't determine what it is. The most likely source seems to be Java since MS Word and Notepad consistently display accent characters.
    Thanks,
    Darin

  • BackGround picture for a Swing application??

    hi,
    once I got a nice idea while watching some webpages. we can give a background picture for a webpage in <body> tag?
    I want to do same thing for any Swing application. Currently I am working on that issue. Any suggestions are welcome!!
    santhosh

    Hi everybody!
    Finally I got it. now Using this We can enable background for any swing application.
    the complete code is shown here. If you have any problems regarding this code, please mail to [email protected]
    /******************************[TexturedImageIcon.java]***********************/
    import java.net.*;
    import java.awt.*;
    import java.awt.event.*;
    import java.awt.geom.*;
    import java.awt.image.*;
    import javax.swing.*;
    /* this is used to generate a tiled image from a given image file.*/
    public class TexturedImageIcon extends ImageIcon
         private Dimension size = new Dimension(10, 10);
         BufferedImage bimg1,bimg;
         Graphics2D g2;
         ComponentListener cl = new ComponentAdapter(){
              public void componentResized(ComponentEvent ce){
                   Component c = (Component)ce.getSource();
                   size = c.getSize();
                   createImage();
         public void setImage(String filename){
              super.setImage(new ImageIcon(filename).getImage());
              bimg1=null;
              createImage();
         public TexturedImageIcon(Component comp, Image img){
              super(img);
              addListener(comp);
         public TexturedImageIcon(Component comp, String filename){
              super(filename);
              addListener(comp);
         public TexturedImageIcon(Component comp, URL url){
              super(url);
              addListener(comp);
         private void addListener(Component comp){
              comp.addComponentListener(cl);
         private void createImage(){
              bimg = new BufferedImage(size.width, size.height, BufferedImage.TYPE_INT_RGB);
              g2 = bimg.createGraphics();
              Rectangle2D rect = new Rectangle2D.Float(0,0,size.width-1, size.height-1);
              Rectangle2D tr = new Rectangle2D.Double(0,0,super.getIconWidth(), super.getIconHeight());
              if(bimg1==null){
                   bimg1 = new BufferedImage(super.getIconWidth(), super.getIconHeight(), BufferedImage.TYPE_INT_RGB);
                   Graphics2D g = bimg1.createGraphics();
                   g.drawImage(super.getImage(), null, null);
              TexturePaint tp = new TexturePaint(bimg1, tr);
              g2.setPaint(tp);
              g2.fill(rect);
         public int getIconWidth(){ return size.width; }
         public int getIconHeight(){ return size.height; }
         public Image getImage(){
              System.out.println("asked");
              return bimg;
         public void paintIcon(Component c, Graphics g, int x, int y){
              Graphics2D g2d =(Graphics2D)g;
              g2d.drawImage(bimg, null, null);
         public static void main(String[] args){
              JFrame f = new JFrame();
              f.setSize(300,300);
              JLabel label = new JLabel();
              label.setBackground(Color.white);
              label.setBorder(BorderFactory.createRaisedBevelBorder());
              label.setIcon(new TexturedImageIcon(label, "world2.gif"));
              f.getContentPane().setLayout(new BorderLayout());
              f.getContentPane().add(label, BorderLayout.CENTER);
              f.show();
    /*********************************[JFCUtils.java]************************/
    /*The main logic to enable background picture lies in this class*/
    public class JFCUtils{
         public static ContainerListener cl = new ContainerAdapter(){
              public void componentAdded(ContainerEvent ce){
                   JComponent child = (JComponent)ce.getChild();
                   child.setOpaque(false);
                   child.addContainerListener(this);
                   addlisteners(child);
         public static TexturedImageIcon enableBackGround(JFrame f, String filename){
              ((JPanel)f.getContentPane()).setOpaque(false);
              JLayeredPane lp = f.getLayeredPane();
              JLabel label = new JLabel();
              TexturedImageIcon icon = new TexturedImageIcon(label, filename);
              label.setIcon(icon);
              JPanel panel = new JPanel(new BorderLayout());
              panel.add(label, BorderLayout.CENTER);
              lp.add(panel, new Integer(Integer.MIN_VALUE));
              Dimension screen = Toolkit.getDefaultToolkit().getScreenSize();
              panel.setBounds(0, 0, screen.width,screen.height);
              addlisteners((JComponent)f.getContentPane());
              return icon;
         private static void addlisteners(Component c){
              c.toString();
              if(c instanceof JComponent) ((JComponent)c).setOpaque(false);
              if(c instanceof Container){
                   Container ct = (Container)c;
                   ct.addContainerListener(cl);          
              for(int i=0; i<ct.getComponentCount(); i++){ //recursivly make all subcomponents transparent
                   Component child = (Component)ct.getComponent(i);
                   addlisteners(child);
         public static void main(String[] args){
              JFrame f = new JFrame();
              enableBackGround(f, "bg.jpg");
              JButton b = new JButton("fdfdfdfd");
              f.getContentPane().add(b, BorderLayout.NORTH);
              f.setSize(300,300);
              f.show();
    /*************************************[UserDialog.java]**************************/
    //to check how a swing application with background looks like
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.event.*;
    public class UserDialog extends JDialog
         JPanel contents = (JPanel)getContentPane();
         JTextField shortField = new JTextField(20);
         JTextField nameField = new JTextField(20);
         JTextField emailField = new JTextField(20);
         JTextField smtpServerField = new JTextField(20);
         JTextField pwdField = new JPasswordField(20);
         JTextField pwdField1 = new JPasswordField(20);
         boolean okay = false;
         public UserDialog(JFrame owner){
              super(owner, "New User Details", true);
              initComponents();
              pack();
              setResizable(false);
         public UserDialog(JDialog owner){
              super(owner, "New User Details", true);
              initComponents();
              pack();
              setResizable(false);
         private void initComponents(){
              JPanel west = new JPanel(new GridLayout(0, 1));
              west.add(new JLabel("Short Name"));
              west.add(new JLabel("Full Name"));
              west.add(new JLabel("Email"));
              west.add(new JLabel("SMTP Server"));
              west.add(new JLabel("Password"));
              west.add(new JLabel("Confirm Password"));
              JPanel east = new JPanel(new GridLayout(0, 1));
              east.add(shortField);
              east.add(nameField);
              east.add(emailField);
              east.add(smtpServerField);
              east.add(pwdField);
              east.add(pwdField1);
              JPanel south = new JPanel();
              JButton ok = new JButton("Ok");
              JButton cancel = new JButton("Cancel");
              south.add(ok);
              south.add(cancel);
              contents.setBorder(JFCUtils.border);
              contents.setLayout(new BorderLayout(10, 10));
              contents.add(west, BorderLayout.WEST);
              contents.add(east, BorderLayout.EAST);
              contents.add(south, BorderLayout.SOUTH);
              ActionListener al = new ActionListener(){
                   public void actionPerformed(ActionEvent ae){
                        okay = ae.getActionCommand().equals("Ok");
                        setVisible(false);
              ok.addActionListener(al);
              cancel.addActionListener(al);
         private void clearFields(){
              shortField.setText("");
              nameField.setText("");
              emailField.setText("");
              smtpServerField.setText("");
              pwdField.setText("");
              pwdField1.setText("");
         public User getUser(){
              clearFields();
              okay = false;
              show();
              if(okay) return new User(shortField.getText(), nameField.getText(), emailField.getText(), smtpServerField.getText(), pwdField.getText());
              else return null;
         public static void main(String[] args){
              Dialog dlg = new UserDialog();
              TexturedImageIcon ticon = JFCUtils.enableBackGround(f, "bg.jpg");.show();
              //we can change the background picture by calling ticon.setImage(...) at runtime.

  • Is there a design pattern for this?

    I'm looking for a solution to a design problem I have.
    For a restaurant booking system I need a number of different opening times describing when you can and cannot book. These opening times are essentially Jodatime Period objects. There's a set of opening times spanning a week and these are repeated for every week (a default set of opening times) however it's possible to override these opening times say for a specific day.
    The domain model would be something like a Restaurant class holding 2 Lists of OpeningTime objects one for defaultOpeningTimes and the other for overiddenOpeningTimes the overidden ones get used if they exist for the requested time period. However the database model would be a bit messy as I'd have 2 lists mapping to the same table (OpeningTime). Is that a good idea? Perhaps there's a design pattern for this, if someone could point me in the right direction I'd be very grateful, or perhaps this is the best solution? Thanks!

    jduprez wrote:
    But why do you put the logic in the database too (I'm no DB expert and I didn't know these concepts until I read your post, but that's what a dynamic view based on derived values looks like to me): performance (1 round-trip instead of two)?Hi jduprez. Long time no speakee.
    I guess part of it is that I spent many years as a DBA and modeller, and really appreciate what it's taught me about design. Also, databases are (or should be) designed from the ground up to provide data-directed requests optimally, and include all sorts of nice stuff like transaction handling that aid consistency, as well as speed.
    That said: I HATE SQL. Think Coliseum, with that emblazoned in 60-foot high letters around its walls, and it might come close to just how much I hate that so-called "language". I hate its form; I hate it's inconsistencies; I hate the fact that something like what OP is trying to do is NOT an easy task (and might involve the creation of a table that simply contains Dates, just in order to satisfy Boolean logic).
    However, once you work it out, a database view (at least from the database's standpoint; JDBC I'm not so sure about) is just like any other Table - and that I DO like.
    Programs are good at processing parameterized (ugh) temporal information; databases are good at persistence and high volume. Those two may meet at some point, but I reckon it's going to take another Codd (or Joda) before it does.
    - that's clearer to 90% of the dev team (my biased numbers, based on 50% of Java developers having decent knowledge of SQL and much less than that having the advanced SQL knowledge which I rank your suggestion at)Sounds to me like you'll get the solution that matches the skills you have then. Is that what you really want, if a better one is available?
    - that doesn't require investigating the if of your suggestion (JDBC support)Agreed, but only because my JDBC knowledge isn't what it could be. I'd also be surprised if it doesn't support access to a named view, since they were designed to be equivalent to Tables.
    - the Op is using DAOs, so it's possible, if profiling does show this is hampering performances, to change that with no impact on the client code that calls the DAO.There's no doubt that a database solution is much higher level than a programming one; but, as I said, it's what they were designed to do. And tinkering around with program optimization has the feel of a "hacker's solution" to me. Not that there's any particular problem with that - I do it quite often when I have no control over my source - but I also try to keep in mind what the "actual" problem is.
    Winston

  • Design Pattern for execution queue

    Anyone know of any good design patterns for using a JMS Queue and MDB's
              as async
              execution queue which maintains execution order by some key
              

    Enforced ordering on redelivery will be supported in the
              next release, but only if the application clamps the pipe-line
              size down to its minimum and the MDB pool size down to one.
              I don't think enforced ordering is supported in the current release.
              We are looking at least partially addressing the general design
              pattern below in the release after next. I don't think I can
              get away with being more specific. (Sorry.) Currently, I
              think something along the line of Larry's solution is the only way to
              accomplish it. Interestingly, the recent thread started
              by "[email protected]" on correlating requests and responses
              seems to be somewhat related.
              Tom, BEA
              Larry Presswood wrote:
              > Well you are both correct however we have something which works
              > however it does involve some threading primitives which generally is not
              > a good idea
              > inside wlas but seems to work.
              >
              >
              > Generally have a singleton on the server which has slots for each key
              > with message
              > numbering for each message and force a wait if message for key is out of
              > order
              > during fifo processing rules. IE do what things you can do in parallel
              > but gate for
              > the last step.
              >
              > I think there is a general remote execution pattern out there.
              >
              > The general problem to solve is this:
              >
              > In a messaging system you want to process messages for each key/session
              > in order however
              > with a large number of sessions its possible to parallel messages for
              > different sessions
              >
              > Otherewise you can either create custom queues or a topic with a
              > selector and then
              > create custom consumers which does not behave as well from a resource
              > perspective
              > as MDB's do.
              >
              >
              >
              >
              >
              >
              >
              > Nick Minutello wrote:
              >
              >>I may be completely wrong - but I think that Larry is referring to the inherant
              >>out-of-order message consumption that you get when using MDB pools to consume
              >>from a Queue.
              >>
              >>In short, the only design pattern here is to deploy the MDB to only one machine
              >>in the cluster - and set the pool size to 1.
              >>
              >>In-order execution is incompatible with the parallel execution that MDB's give
              >>you.
              >>
              >>-Nick
              >>
              >>
              >>
              >>Tom Barnes <[email protected]> wrote:
              >>
              >>
              >>>Hi Larry,
              >>>
              >>>Generally, I think it is best to have a seperate queue per key if the
              >>>
              >>>number of keys is small. This prevents starvation of a particular
              >>>message. For example when handling message-priority, low priority gets
              >>>
              >>>an MDB pool of size 1, high priority gets and MDB pool of size 10.
              >>>
              >>>Note that WebLogic JMS allows a queue to specify a sort-order keys based
              >>>on arbitrary message fields. Note that the in-flight message pipe-line
              >>>
              >>>between server and asynchronous clients is unsorted.
              >>>
              >>>Tom, BEA
              >>>
              >>>Larry Presswood wrote:
              >>>
              >>>
              >>>>Anyone know of any good design patterns for using a JMS Queue and MDB's
              >>>>
              >>>>
              >>>>as async
              >>>>execution queue which maintains execution order by some key
              >>>>
              >>>>
              >>>>
              >>
              >>
              >>
              >
              

  • Flex design pattern for BlazeDS transfer objects

    Dear Community,
    I have a question regarding the nature of objects transferd from BlazeDS backend to the Flex client.
    According to some adobe docs all the presentation logic should be in flex and BlazeDS should provide only services.
    The question is what kind of transfer objects should be used? with what level of abstraction?
    To make it more clear let's talk about a simple forum application like adobe forums.
    I have created a Forum service, which returns a Forum transfer object, which has a List of Threads, with each thread having a List of Messages.
    Flex gets the Forum transfer object and does all the presentaiton work.
    This is a very nice seperatin of concerns architecture BUT there are two major performance issues:
    - when the forum becomes bigger the transfer object will be huge
    - the flex will use huge client resources to create the presentation of the forum transfer object.
    So my question is what is your strategy/ design pattern for such a problem.
    An obvious answer would be create services that include the presentation logic and use transfor objects like ThreadListPage which will include only the first 10 threads.
    Thanks in advance

    I think you are going to get a few varied types of answers to a general question like this, but I will comment on a few things.  First, you should only be transmitting the data that you need to use or display to the user at the time.  If this forum was implemented in Flex (I wish) you wouldn't transfer the text for all the threads.  You might not transfer the thread text at all (just the subjects), you'd make calls back to the server to fetch that data when and if you need it.
    Also, I think you are overestimating the resources required for the Flex "presentation layer".  If you think about it, these workstations we have here are pretty idle most of the time when you're at a website.  Nowadays there's plenty of processing power just sitting there waiting, so as long as your design isn't flawed the CPU or memory are rarely going to be a bottleneck with Flex.
    The way I design, BlazeDS (or GraniteDS etc) should mostly just be "serving data".  There is some flexibility available, for example I don't see a problem with putting certain types of business rules (such as a limit on the number of results that can be recieved in a search) within server side code, and validation rules on the Flex side.  So there's not too many "industry standards" in Flex yet beyond maybe what's done in the various standard architectures, at least not that I'm aware of.
    You might find it beneficial to look into some of the various frameworks/architectures available like Cairngorm, Mate, Swiz, and so on.  Learning how they work (looking at examples) would probably answer some of your questions too.

  • Design Pattern For Web Services.

    I tried asking siomilar questions in WebService Forum but didn'y got any replies.
    Can anybody tell me what should be the Design for Web Services.
    I have understanding that there can be just 1 Interface/Implementation class for each Web Service, and which will have 1 end point.So for evry such Interface we will have to have 1 Web Service.
    Can someone please clarify wheather I'm correct or not ?
    I guess that If my application has many Interfaces and I have to expose the application as Web Service.Then I will have to expose all methods from one Interface and then expose this new Interface as Web Service.
    Is this how WS will work.
    Any pointers to design PATTERNS for Web Service will be highly appreciated.
    Thanks
    Rahul

    I don't know if anyone has documented new patterns specifically aimed at web services but the old ones definitely apply. Like you were alluding to, there is a letter-envelope decoupling of interface and implementation with the XML WSDL interface and coded implementation.

  • Design pattern for IFS

    Hi,
    I am new to Oracle IFS. I just want to know Is there any proven design pattern for IFS application development.

    The class could have only private constructors and a public static getter method, which would decide based on some collection of the object created so far, whether to create a new one or give an old one.

  • How to create the digital clock in java swing application ?

    I want to create the running digital clock in my java swing application. Can someone throw some light on this how to do this ? Or If someone has done it then can someone pl. paste the code ?
    Thanks.

    hi prah_Rich,
    I have created a digital clock you can use. You will most likely have to change some things to use it in another app although that shouldn't be too hard. A least it can give you some ideas on how to create one of your own. There are three classes.One that creates the numbers. a gui class and frame class.
    cheers:)
    Hex45
    import java.awt.*;
    import java.util.*;
    import javax.swing.*;
    import java.awt.geom.*;
    public class DigitalClock extends Panel{
              BasicStroke stroke = new BasicStroke(4,BasicStroke.CAP_ROUND,
                                               BasicStroke.JOIN_BEVEL);
              String hour1, hour2;
              String minute1, minute2;
              String second1, second2;
              String mill1, mill2, mill3;
              int hr1, hr2;
              int min1, min2;
              int sec1, sec2;
              int mll1, mll2,mll3;       
        public void update(Graphics g){
             paint(g);
         public void paint(Graphics g){
              Graphics2D g2D = (Graphics2D)g;
              DigitalNumber num = new DigitalNumber(10,10,20,Color.cyan,Color.black);     
              GregorianCalendar c = new GregorianCalendar();
              String hour = String.valueOf(c.get(Calendar.HOUR));
              String minute = String.valueOf(c.get(Calendar.MINUTE));
              String second = String.valueOf(c.get(Calendar.SECOND));
              String milliSecond = String.valueOf(c.get(Calendar.MILLISECOND));
              if(hour.length()==2){
                   hour1 = hour.substring(0,1);
                   hour2 = hour.substring(1,2);
              }else{
                   hour1 = "0";
                   hour2 = hour.substring(0,1);
              if(minute.length()==2){
                   minute1 = minute.substring(0,1);
                   minute2 = minute.substring(1,2);
              }else{
                   minute1 = "0";
                   minute2 = minute.substring(0,1);
              if(second.length()==2){
                   second1 = second.substring(0,1);
                   second2 = second.substring(1,2);
              }else{
                   second1 = "0";
                   second2 = second.substring(0,1);
              if(milliSecond.length()==3){
                   mill1 = milliSecond.substring(0,1);
                   mill2 = milliSecond.substring(1,2);
                   mill3 = milliSecond.substring(2,3);
              }else if(milliSecond.length()==2){
                   mill1 = "0";
                   mill2 = milliSecond.substring(0,1);
                   mill3 = milliSecond.substring(1,2);
              }else{
                   mill1 = "0";
                   mill2 = "0";
                   mill3 = milliSecond.substring(0,1);
              hr1  = Integer.parseInt(hour1);     
              hr2  = Integer.parseInt(hour2);
              min1 = Integer.parseInt(minute1);
              min2 = Integer.parseInt(minute2);
              sec1 = Integer.parseInt(second1);
              sec2 = Integer.parseInt(second2);
              mll1 = Integer.parseInt(mill1);
              mll2 = Integer.parseInt(mill2);
              g2D.setStroke(stroke);
              g2D.setPaint(Color.cyan);
              num.setSpacing(true,8);
              num.setSpacing(true,8);
              if(hr1==0&hr2==0){
                   num.drawNumber(1,g2D);
                   num.setLocation(40,10);
                   num.drawNumber(2,g2D);
              else{
                   if(!(hr1 == 0)){     
                        num.drawNumber(hr1,g2D);
                   num.setLocation(40,10);
                   num.drawNumber(hr2,g2D);
              num.setLocation(70,10);
              num.drawNumber(DigitalNumber.DOTS,g2D);
              num.setLocation(100,10);
              num.drawNumber(min1,g2D);
              num.setLocation(130,10);
              num.drawNumber(min2,g2D);
              num.setLocation(160,10);
              num.drawNumber(DigitalNumber.DOTS,g2D);
              num.setLocation(190,10);
              num.drawNumber(sec1,g2D);
              num.setLocation(220,10);
              num.drawNumber(sec2,g2D);
              /*num.setLocation(250,10);
              num.drawNumber(DigitalNumber.DOTS,g2D);
              num.setLocation(280,10);
              num.drawNumber(mll1,g2D);
              num.setLocation(310,10);
              num.drawNumber(mll2,g2D);
              g2D.setPaint(Color.cyan);
              if((c.get(Calendar.AM_PM))==Calendar.AM){               
                   g2D.drawString("AM",260,20);
              }else{
                   g2D.drawString("PM",260,20);
         String dayOfweek = "";     
         switch(c.get(Calendar.DAY_OF_WEEK)){
              case(Calendar.SUNDAY):
                   dayOfweek = "Sunday, ";
                   break;
              case(Calendar.MONDAY):
                   dayOfweek = "Monday, ";
                   break;
              case(Calendar.TUESDAY):
                   dayOfweek = "Tuesday, ";
                   break;
              case(Calendar.WEDNESDAY):
                   dayOfweek = "Wednesday, ";
                   break;
              case(Calendar.THURSDAY):
                   dayOfweek = "Thursday, ";
                   break;
              case(Calendar.FRIDAY):
                   dayOfweek = "Friday, ";
                   break;
              case(Calendar.SATURDAY):
                   dayOfweek = "Saturday, ";
                   break;
         String month = "";     
         switch(c.get(Calendar.MONTH)){
              case(Calendar.JANUARY):
                   month = "January ";
                   break;
              case(Calendar.FEBRUARY):
                   month = "February ";
                   break;
              case(Calendar.MARCH):
                   month = "March ";
                   break;
              case(Calendar.APRIL):
                   month = "April ";
                   break;
              case(Calendar.MAY):
                   month = "May ";
                   break;
              case(Calendar.JUNE):
                   month = "June ";
                   break;
              case(Calendar.JULY):
                   month = "July ";
                   break;
              case(Calendar.AUGUST):
                   month = "August ";
                   break;
              case(Calendar.SEPTEMBER):
                   month = "September ";
                   break;
              case(Calendar.OCTOBER):
                   month = "October ";
                   break;
              case(Calendar.NOVEMBER):
                   month = "November ";
                   break;
              case(Calendar.DECEMBER):
                   month = "December ";
                   break;
         int day = c.get(Calendar.DAY_OF_MONTH);
         int year = c.get(Calendar.YEAR);
         Font font = new Font("serif",Font.PLAIN,24);
         g2D.setFont(font);
         g2D.drawString(dayOfweek+month+day+", "+year,10,80);
         public static void main(String args[]){
              AppFrame aframe = new AppFrame("Digital Clock");
              Container cpane = aframe.getContentPane();
              final DigitalClock dc = new DigitalClock();
              dc.setBackground(Color.black);
              cpane.add(dc,BorderLayout.CENTER);
              aframe.setSize(310,120);
              aframe.setVisible(true);
              class Task extends TimerTask {
                 public void run() {
                      dc.repaint();
              java.util.Timer timer = new java.util.Timer();
             timer.schedule(new Task(),0L,250L);
    class DigitalNumber {
         private float x=0;
         private float y=0;
         private float size=5;
         private int number;
         private Shape s;
         private float space = 0;
         public static final int DOTS = 10;
         private Color on,off;
         DigitalNumber(){          
              this(0f,0f,5f,Color.cyan,Color.black);          
         DigitalNumber(float x,float y, float size,Color on,Color off){
              this.x = x;
              this.y = y;
              this.size = size;
              this.on = on;
              this.off = off;
         public void drawNumber(int number,Graphics2D g){
              int flag = 0;
              switch(number){
                   case(0):          
                        flag = 125;
                        break;
                   case(1):
                        flag = 96;
                        break;
                   case(2):
                        flag = 55;
                        break;
                   case(3):
                        flag = 103;
                        break;
                   case(4):
                        flag = 106;
                        break;
                   case(5):
                        flag = 79;
                        break;
                   case(6):
                        flag = 94;
                        break;
                   case(7):
                        flag = 97;
                        break;
                   case(8):
                        flag = 127;
                        break;
                   case(9):
                        flag = 107;
                        break;
                   case(DOTS):
                        GeneralPath path = new GeneralPath();
                        path.moveTo(x+(size/2),y+(size/2)-1);
                        path.lineTo(x+(size/2),y+(size/2)+1);
                        path.moveTo(x+(size/2),y+(size/2)+size-1);
                        path.lineTo(x+(size/2),y+(size/2)+size+1);
                        g.setPaint(on);
                        g.draw(path);     
                        return;
              //Top          
              if((flag & 1) == 1){
                   g.setPaint(on);
              }else{
                   g.setPaint(off);
              GeneralPath Top = new GeneralPath();
              Top.moveTo(x + space, y);
              Top.lineTo(x + size - space, y);
              g.draw(Top);
              //Middle
              if((flag & 2) == 2){
                   g.setPaint(on);
              }else{
                   g.setPaint(off);
              GeneralPath Middle = new GeneralPath();
              Middle.moveTo(x + space, y + size); 
              Middle.lineTo(x + size - space,y + size);     
              g.draw(Middle);
              //Bottom
              if((flag & 4) == 4){
                   g.setPaint(on);
              }else{
                   g.setPaint(off);
              GeneralPath Bottom = new GeneralPath();
              Bottom.moveTo(x + space, y + (size * 2));  
              Bottom.lineTo(x + size - space, y + (size * 2));
              g.draw(Bottom);
              //TopLeft
              if((flag & 8) == 8){
                   g.setPaint(on);
              }else{
                   g.setPaint(off);
              GeneralPath TopLeft = new GeneralPath();     
              TopLeft.moveTo(x, y + space);
              TopLeft.lineTo(x, y + size - space);          
              g.draw(TopLeft);
              //BottomLeft
              if((flag & 16) == 16){
                   g.setPaint(on);
              }else{
                   g.setPaint(off);
              GeneralPath BottomLeft = new GeneralPath();     
              BottomLeft.moveTo(x, y + size + space);
              BottomLeft.lineTo(x, y + (size * 2) - space);
              g.draw(BottomLeft);
              //TopRight
              if((flag & 32) == 32){
                   g.setPaint(on);
              }else{
                   g.setPaint(off);
              GeneralPath TopRight = new GeneralPath();     
              TopRight.moveTo(x + size, y + space);
              TopRight.lineTo(x + size, y + size - space);
              g.draw(TopRight);
              //BottomRight
              if((flag & 64) == 64){
                   g.setPaint(on);
              }else{
                   g.setPaint(off);
              GeneralPath BottomRight = new GeneralPath();     
              BottomRight.moveTo(x + size, y + size + space);
              BottomRight.lineTo(x + size, y + (size * 2) - space);
              g.draw(BottomRight);
         public void setSpacing(boolean spacingOn){
              if(spacingOn == false){
                   space = 0;
              else{
                   this.setSpacing(spacingOn,5f);
         public void setSpacing(boolean spacingOn,float gap){
              if(gap<2){
                   gap = 2;
              if(spacingOn == true){
                   space = size/gap;
         public void setLocation(float x,float y){
              this.x = x;
              this.y = y;
         public void setSize(float size){
              this.size = size;
    class AppFrame extends JFrame{
         AppFrame(){
              this("Demo Frame");
         AppFrame(String title){
              super(title);
              setSize(500,500);
              setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    }

Maybe you are looking for

  • How to share administrator iPhoto library with other users on same iMac?

    How to share administrator iPhoto library with other users on same iMac?

  • Three monitor setup, Only use one of them?

    Hi! Before i buy a third monitor I want to make sure everything work as expected. I need to be able to switch between the monitors so sometimes I want all of them to be active, sometimes only two or one of them. How do i switch between those modes? I

  • Java.io.Console

    I was reading a sun tutorial and it had a test program that contains the import statement java.io.console. The problem is my java can't seem to find this class, i'm quite sure i have the newest version of java. Any ideas? heres the page for the test

  • No value could be determined for variable 0P_FVAEX

    We are on BW 7.0 and BEx7.0 I have activated BI Content of InfoCube  0WBS_C11 and all it's SAP delivered Query elements. The InfoCube is loaded with data already. When I run any of the query in BEx, I got the same error as below: Initial RANGE-LOW fo

  • Schedule Job Failed

    I submitted a job using enterprise manager and the job was fail with the error message "VNI-2015 : authentication error". The preferred credentials setting for database is "sys" and for the node is domain administrator. Running Oracle8i and EM2.0 on