Client-Server - SOA.... Is it really a transition or a big development  ?

Hi,
In all sources related to SOA/ESA by SAP, it is said that, transitioning from Client-Server Arch(CSA) to SOA is the same as transitioning from Mainframe systems to Client-Server Arch.
If we think about Mainframe and CSA, it is obvious that there had been big differences in that transition. Such as, the INTELLIGENT CLIENT concept had appeared to replace the DUMMY CLIENTS, so this had changed the way of IT Business. There would be a main application providing several functionalities(server) and other applications which want to use those functionalities (clients) would connect to the server using some functionalities on its own (that means a client appliction should also have some functionalities in order to at least connect to the server, so that made them different from the DUMMY clients of the mainframe era)
Now, when I look at the differences between SOA and CSA, I cannot see that incompareble differences.Why ? Let me explain :
- One of the most important differences between SOA and CSA is, SOA is vendor and platform independent, so that any application can call any applications functionality as long as they are using Web Services. That is true. But the question arises here : It is still the case that someone is calling some others' functionalities (services), so there is still a client/server mentality, isn't there and We will still be using several client/server programming languages in order to realize the main functionality of the web services but this will be transparent to the user and the integration. The main difference is, SOA is vendor and platform independent. But I don't think this can be commented as a missing feature of CSA. Because the aim of CSA was to make the clients more intelligent and not to make them vendor/platform independent. And also architectures like CORBA and DCOM have also tried to achieve that independency (even though they have restrictions compared to Web Services, one of the main reasons for this is using Web as a transport/communication protocol) but they are still treated as some extensions on top of CSA because they are using CSA beneath. But if we compare Mainframes and CSA, even though I haven't seen manframe ages, I think it is clear that CSA does not use any architectural functionality of Mainframes. They are completely different.. But is SOA and CSA completely different ?
I agree with all reasons why today business needs sth more agile, more flexible and it is becoming clearer day by day that SOA and Web Services provides this environment, BUT, I still cannot make it clear, WHY it is accepted as a transition from CSA and why it is not treated as a big development over CSA while using the main features of it.
Any comments will be appreciated.
Regards
Ahmet Engin Tekin

Good point..Actually those are the things clearly known but it becomes a bit confusing to build clear sentences when it comes to declare the differences. Anyway, here are my additions :
- Mainframes were centralized systems which had their own hardware architecture as well. All processes/applications were running on 1 central DB/system and everyone in the company had to use the same functionality and interface.
- In time, as a result of business demand, people needed different functionalities/applications regarding different business needs. This could either be done by extending the higly-costed big mainframe systems/softwares OR a new approach had to be developed in order to solve those problems. At this point, (thanks to IBM,Macintosh and Xerox) PC and ethernet concepts had emerged. That was a completely different hardware architecture which allowed less costly systems and also distributing the process load and/or applications to different systems in one landscape (app servers, intelligent clients - 2 tier, 3- tier arch.). Thus, while those were happening on harware side, new communication and programming models/languages emerged on software side. As a result, people started using different applications on different systems according to their needs and thus an efficient solution had been provided to the business need (described above).
To criticise, this was really a big transition. Not only software concepts but also hardware concepts are also changed drastically. Actually, it is not wrong if we say, developments on the hardware side, allowed changes on the software side
- What happened next ? Companies started using so many different applications by different vendors with different business logic and programming models (thanks to CSA). But in times, this has emerged the biggest problem of the CSA era : Integration.
We all know the rest. "Web Services" concept emerged with SOA as well. So that, the boundaries between the systems began to disappear.
So, is this a transition ? Well, yes it is.. The point that made it confusing (at least for me) is that this time there is no hardware transition (yet) but only a transition in software side. But I still insist that the IT transition during Mainframe->CSA was like a revolution (forget what you've left behind) but from CSA to SOA; it is more likely to be an evolution (the next best thing)
Anyone have more comments ?
Regards,
Ahmet

Similar Messages

  • Can i use forms 9i for client server applicaitons

    Hi,
    I have to build a client/server application.Right now, we are using oracle 9i and developer suite 10g. In one of the articles on OTN, it says that from forms 9i onwards, it's not supporting client/server model. Do i have to use 6i for this.
    Thank you.
    Sree.

    The last Forms version that can be run in c/s mode is 6i.

  • Run a report made in Rerports 9i in client/server environment

    Hello
    I need to run a report made in Reports 9i in a client/server environment, but we don´t want to install the developer suite. Reports 6i had a runtime tool how can i do in Reports 9i?
    PD: si alguien me puede responder en español seria fantastico.
    Thank you
    Angelo J. Gonzalez

    In client server mode you can use RUN_PRODUCT built-in. Lookup help for this built-in for more details.
    Best of luck!

  • Client - Server on Internet

    Hi everybody.
    I have always realized applications Client - Server. The users were using an application of windows developed in Java, which was attacking a database server, being all the users inside a local network (in the same building).
    Now I have to make an application where the users (on approximately 50 in whole) are distributed by the face of the world, for what the application will have to communicate to itself across Internet.
    This presents to me three doubts (possibly some of the things that I say do not have greatly sense, due to my void experience in this ambience, ask a little of comprehension before judging the post):
    What type of user's interface do I use?
    It might use a traditional windows application, use a web navigator, applets, html, web 2.0, javafx?.
    What type of server do I use?
    I do not believe that it is suitable to attack straight to the database, therefore I will have to use a server who takes charge of the business rules. What can I use? Is it possible to use hostings of third for the server (with the business rules)? Do you know anyone?
    What type of comunication do I use?:
    html?: web services?: others? I suppose that they will have frameworks, applications, etc. to help to develop this type of computer systems. Do you know anyone?
    Since you can see, here there is many cloth. He would be grateful that you were giving me a light idea of that it could use, it would be marvelous if you can give me references (docs, you paginate webs, forums, blogs, etc) to be able to begin and study in depth the topic.
    Thank you very much for your help.

    TechGSis wrote:
    What type of user's interface do I use?
    It might use a traditional windows application, use a web navigator, applets, html, web 2.0, javafx?.
    yes.
    What type of server do I use?
    I do not believe that it is suitable to attack straight to the database, therefore I will have to use a server who takes charge of the business rules. What can I use? Is it possible to use hostings of third for the server (with the business rules)? Do you know anyone?
    That would depend on what you want the server to do of course.
    What type of comunication do I use?:
    html?: web services?: others? I suppose that they will have frameworks, applications, etc. to help to develop this type of computer systems. Do you know anyone?
    for example.
    But the only thing we can tell you is to use TCP. Whatever you send over that would depend on your decisions re clients and servers.

  • WARNING - Oracle intends to desupport Forms client server mode

    When Forms 6i becomes desupported you will have to move to Forms 9i. Forms 9i runtime can only be run in web mode from a web browser. You will not be able to run client-server forms in native operating systems such as Windows or Unix. The forms will essentially run on the application server with Java applets to being sent to your web browser. Links to third party products will no longer work with host commands executing on your local machine. You will have to include Java code to make local commands work.
    The transition from Forms 6i client-server to Forms 9i web mode will be one of the most painful upgrades Oracle has ever inflicted on its customers.
    Essentially, Oracle is trying to palm us off with running forms from web browsers whether we or our customers like it or not. Java seems to be creeping in. I suspect Developer will eventually turn into JDeveloper, as they will not want to support two products. Easy one line statements and built-ins will be replaced by hundreds of lines of Java nonsense. Developer will move from a 4GL RAD environment to a cumbersome bloated 3GL Java environment.
    You can stop this happening if you want to keep you customers happy by:
    1. Sending Oracle enhancement requests to allow Forms 9i to run in native client-server mode.
    2. Complaining to your Oracle sales contact.
    3. Asking difficult questions at Oracle user groups.

    Duncan et al.,
    I've been wondering why exactly a Forms9i app. needs to run in a web page? Why could the applet not be deployed in a more "standalone" fashion, i.e., an independent application window. This would at least offer the appearance of a native application, complete with the new Java look-and-feel.
    If Oracle really wanted make their customers happy, they would then take the next step and come up with a way to embed OC4J into a client-side deployment executable, which would then effectively allow for a 2-tier client-server architecture.
    It seems to me that 2-tier/3-tier each have their place in the world, depending on the situation. In the extreme "2-tier" example would be an application that is to be deployed on a single client workstation. It would be hard to argue that a separate application server ought to be used. On the other extreme, anybody who has tried to manage the deployment--and upgrade--of a large number of Forms clients is very attracted to the prospect of only having to maintain and upgrade a few application servers.
    I agree with the direction of the product as far as replacing Toolkit2 and the native runtime with the JRE. The advantage of on-demand updating of application code is compelling. The capability of moving application logic to the middle tier is extremely useful. Platform independence is now done using the "universal" JRE instead of TK2.
    If the product could maintain the client-side processing capability--without resorting to Javabeans--it would be just that much stronger. As an application architect, I want to be able to design the application to allocate the work where it makes the most sense, either on the client, the application server, or the database server.
    How hard would it be to put this client-side processing capability back into the product?
    Regards,
    Bruce MacDonald

  • Client/Server hang up?

    I'm writing a basic client server program. I created an ArrayList to hold all the sockets of a connection so each client could, hopefully, eventually interact.
    Right now my client is a text field with a text area under it. A user types a command up top and then hits enter and sends that along to the server. However when i send in the message it seems to hang up and never sends back a reply. But what's really odd about it, is that if i close my server window and there by shutting it down the client then outputs exactly what i expected it to if it was working right. So im curious why there's this hangup in my code?
    Server:
    import java.awt.BorderLayout;
    import java.awt.Font;
    import java.io.IOException;
    import java.net.InetAddress;
    import java.net.ServerSocket;
    import java.net.Socket;
    import java.util.ArrayList;
    import javax.swing.JFrame;
    import javax.swing.JScrollPane;
    import javax.swing.JTextArea;
    public class Server extends JFrame{
              private JTextArea jta = new JTextArea();
              private static ArrayList<Socket> clients = new ArrayList<Socket>();
              public Server(){
                   getContentPane().setLayout(new BorderLayout());
                   getContentPane().add(new JScrollPane(jta), BorderLayout.CENTER);
                   jta.setFont( new Font( "Times", Font.BOLD, 20));
                   setSize(500, 300);
                   setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
                   setVisible(true);
                   try{
                        setTitle("Server: " + InetAddress.getLocalHost().getHostName());
                        int clientNo = 1;
                        ServerSocket serverSocket = new ServerSocket(0);
                        jta.append("Port: " + serverSocket.getLocalPort() + "\n");
                        while(true){
                             Socket socket = serverSocket.accept();
                             InetAddress inetAddress = socket.getInetAddress();
                             clients.add(socket);
                             World thread = new World(socket);
                             jta.append("Connected with client :" + clientNo + "\n");
                             thread.start();
                             clientNo++;
                   }catch(IOException ex){
                        System.err.println(ex);
              public static void main(String[] args){
                   new Server();
              public static ArrayList getClients(){
                   return clients;
         }World:
    import java.io.IOException;
    import java.io.PrintWriter;
    import java.net.InetAddress;
    import java.net.Socket;
    import java.util.ArrayList;
    import java.util.Scanner;
    public class World extends Thread {
         private Socket mySocket;
         private int myPort;
         private InetAddress myInetAddress;
         private String myHostName;
         private ArrayList<Socket> theClients;
         public World(Socket newSocket) {
              mySocket = newSocket;
              myPort = mySocket.getPort();
              myInetAddress = mySocket.getInetAddress();
              myHostName = myInetAddress.getHostName();
         public void run() {
              String test;
              Scanner input = null;
              PrintWriter output = null;
              try {
                   String fileName;
                   input = new Scanner(mySocket.getInputStream());
                   output = new PrintWriter(mySocket.getOutputStream(), true);
              }catch(IOException e){
              output.println("Please Enter Command");
              while((test = input.nextLine()) != null){
                   if(test.contains("get clients") ){
                        theClients = Server.getClients();
                        for(int i = 0; i < theClients.size(); i++){
                             output.println(theClients.get(i).getInetAddress().getHostName());
                        output.flush();
                   }else{
                        output.println("not sure");
                        output.flush();
    }Client:
    import java.awt.*;
    import java.awt.event.*;
    import java.io.*;
    import java.net.*;
    import java.util.Scanner;
    import javax.swing.*;
    public class Client extends JFrame implements ActionListener{
         private JTextField jtf;
         private JTextArea jta = new JTextArea();
         private PrintWriter output;
         private Scanner input;
         public Client(String host, int port){
              JPanel p1 = new JPanel();
              p1.setLayout(new BorderLayout());
              p1.add(jtf = new JTextField(10), BorderLayout.CENTER);
              jtf.setHorizontalAlignment(JTextField.RIGHT);
              jtf.setFont(new Font("Times", Font.BOLD, 20));
              jta.setFont(new Font("Times", Font.BOLD, 20));
              getContentPane().setLayout(new BorderLayout());
              getContentPane().add(p1, BorderLayout.NORTH);
              getContentPane().add(new JScrollPane(jta), BorderLayout.CENTER);
              jtf.addActionListener(this);
              setSize(500,300);
              setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
              setVisible(true);
              try{
                   setTitle("Client: " + InetAddress.getLocalHost().getHostName());
                   Socket socket = new Socket(host, port);
                   input = new Scanner(socket.getInputStream());
                   output = new PrintWriter(socket.getOutputStream(), true);
                   jta.append(input.nextLine() + "\n");
              }catch(IOException ex){
                   jta.append(ex.toString() + "\n");
         public void actionPerformed(ActionEvent e){
              String nextLine;
              String findFile = jtf.getText().trim();
              ((JTextField)(e.getSource())).setEditable(false);
              if ( e.getSource() instanceof JTextField){
                        jta.append("Getting file: \"" + findFile + "\" \n");
                        output.println(findFile);
                        output.flush();
                        while(input.hasNext()){
                             nextLine = input.nextLine();
                             jta.append(nextLine + "\n");
         public static void main(String[] args){
              int portSend;
              if (args.length != 2){
                   System.out.println("not Enough arguments");
                   System.exit(-1);
              portSend = Integer.parseInt(args[1]);
              new Client(args[0], portSend);
    }

    Don't run networking code in the constructor. Start a separate thread for the accept loop.

  • Client/server vs. Application Server

    Our company has around 30 sites with each one having its own Oracle database server and file server (repository for executables of Forms6i/Reports6i). All the sites have the same applications running, i.e., the same set of programs are replicated to each site. At present we are running the applications in client/server mode (Forms6i/Reports6i runtime is installed on each client machine).
    We are also using some third party modules developed in VB/VC++.
    Now we are looking for the Centralized Solution, i.e., We want to have a Single Database Server available to all the sites all the sites are already linked with Network Leased lines).
    Now we want to know the impact of running centralized file server (located at Corporate Office site) accessible from all the sites (through same client/server mode).
    Will this solution work for us or we should move to 3-tier mode? Please suggest us the best feasible solution which can be implemented as early as possible.
    What I mean to ask in the question above is: if a good intranet connectivity is available among sites, what would be the better approach, client/server or n-tier?
    What actually would we gain by using application server in this context? Does the Data travelling is reduced from Database Server through to the Client Node in 3-tier AS approach? Does this 3-tier approach will reduce the Burden on Leased Lines? Does we gain more network resources available in 3-tier?
    What I think is that in client/server mode, the data is travelled from Database Server to Client Machine, but using Application Server, the Data from Database Server will travel upto Application Server and NOT to the Cleint machine (on browser etc.), hence reducing Network Load.
    Please clarify as your input makes a valuable role in our decision-making.

    Hello,
    I'll take a stab at this one...
    If you have enough network bandwidth, you should be fine funning in client/server mode. I have worked with clients with this same configuration. In addition to having a centralized DB, we have also centralized the forms on a network drive allowing users to access the same files and removing the need for users having to update their files locally. The biggest problem I see with this configuration, as long as you have enough band width, is that your configuration is not supported as 6i has been desupported.
    From my perspective you really don't have any choice but to upgrade your application so that you can be supported. The good news is that for the clients we have worked with upgrades have gone very smoothly. In fact recently we have started to partner with another vendor that has a tool specifically designed to upgrade Oracle Forms and it includes additional features above and beyond what you get from Oracle. This tool has drastically reduced the amount of time to complete upgrades (like going from a 2 year project to just a few weeks).
    I hate to answer this question because it is hard to answer without really getting into the details with you. The good news is once you do have a centralized DB and centralized application maintenance will be significantly easier.
    One last option you might consider that our company has done is to use Citrix. I've never used it for Oracle Forms, but for other client/server applications it has allowed out clients to web enabled their existing applications without changing them at all and also get a boost in performance. I wouldn't recommend this approach to you because what you have should be short term until you get your forms/reports upgraded.
    If you have any specific questions I can try and answer them for you. Good luck and let me know if I can be of any assistance.

  • OLE Alternatives in Forms 6i Client Server

    I'm fishing for some advice and maybe some examples of how to get around an OLE issue that's adversely affecting an upgrade project.
    We're currently migrating a Forms 4.5 application to 6i. This application displays MS Word documents (OLE Container) that are stored in the database and uses OLE to open manipulate, and save the documents back to the database. We've come across some serious problems with OLE and 6i that don't look like they'll be fixed any time soon (bug #2615804 in particular).
    Since OLE (ActiveX) is not supported a web delivered configuration, we're looking at an alternative to interacting and storing Word documents using a client/server configuration. This will have the added bonus of making the move to web delivery once we decide to go down that path.
    Has anyone out there had any good experience with overcoming this OLE problem? It seems like every pre-Forms 9i book out there has touted OLE as a way of interacting with Office tools and now OLE has become a roadblock.
    I've had a look at the JACOB example, but that doesn't really help if you're not deploying via the web.

    With the beans you've looking at visual stuff : like the look and feel project
    With the importer it's more like leveraging java functionality : in my case I've just implemented a call to a webservice on an application server. There is nothing visual here and it's just called via a straight bit of PL/SQL that call my java classes ( however, in that case I could also use UTL_HTTP directly to make the call and thus not bother with java importer - but the database wouldn't allow UTL_HTTP calls :( )
    For both of these you'd need to tell forms where to find the JAR file in it's java environment - but you won't have that in c/s
    Another way is to load up java code into the database and process it within the database and hide it completely from Forms. I've done this sort of thing loading Apache-FOP into Oracle and creating PDF files in the database (as BLOBS) from XML/XSL also in the database as XMLTYPES.
    At least that's my view on how it fits together ... maybe others know more :)
    Steve

  • Small client server project.  deisgn idea good or bad?

    Hi,
    I have a question:
    I have this plan to make a small Swing based GUI on the client machine (that I would like a novice user to be able to double click on to launch) which needs to connect to a Server side component , I am thinking a simple Servlet or JSP page. Then what needs to happen is a few messages are transferred to ascertain the users identity for authenitcation as so:
    1. Client -> Server 2. Server -> Client 3. Client -> Server. Access gratned or not for access to restricted web page (imagine inbox e-banking etc)
    So the main questions are:
    1. Can I make a small Swing based GUI App, NOT an applet as I need to read from the client, that can be easily launched by an idiot ;)
    2. Can that small app converse with a Servlet in the manner described above.
    3. Kinda like 2. Can the Client App launch a browser window to that when the messages are done the user can then get into the area the server has granted them access to (depending on the messages).
    I would really appriciate the help. I have looked about on the internet and in books but I never really got a succinct picture this would be possible.
    Thanks!

    I have this plan to make a small Swing based GUI on
    the client machine (that I would like a novice user
    to be able to double click on to launch) which needs
    to connect to a Server side component , I am thinking
    a simple Servlet or JSP page. That will involve writing an applet.
    1. Can I make a small Swing based GUI App, I don't know if you can or not! It's certainly possible...
    NOT an applet See above.
    as I need to read from the client, That's not a restriction. You can sign your applets.
    that can be easily launched by an idiot ;) Once again, that's up to you.
    2. Can that small app converse with a Servlet in the
    manner described above.Yes.
    3. Kinda like 2. Can the Client App launch a browser
    window to that when the messages are done the user
    can then get into the area the server has granted
    them access to (depending on the messages).Yes.
    I would really appriciate the help. I have looked
    about on the internet and in books but I never really
    got a succinct picture this would be possible.It is! Good luck, and happy coding! If you need some resources, check out the following:
    The Java� Tutorial - Trail: Creating a GUI with JFC/Swing
    The Java� Tutorial - Trail: Writing Applets
    Trail: Getting Started - Lesson: The Anatomy of an Applet
    Java Applet Tutorials
    The Java� Tutorial - I/O: Reading and Writing (but no 'rithmetic)

  • JavaFX as a SaaS/ How good is it for Client-Server work?

    I was under the impression that FX could be used to produce a Client-Server application as well as SaaS.
    a member of another forum said "I'm sure you meant to say "Desktop". JavaFX will not be making inroads on the web as a client-side technology."
    To which I said
    There have been examples of FX used with EE
    http://www.oracle.com/technetwork/java/javafx/samples/index.html
    http://docs.oracle.com/javafx/2/overview/jfxpub-overview.htm
    Sales Dashboard (DataApp)
    DataApp is a client-server application for a fictional global automobile company called Henley Car Sales. Automobile sales are simulated on an EJB server using JavaDB, and the data is available via Derby and a RESTful web service. The client demonstrates a variety of data presentations by using a mix of FXML and JavaFX.
    I thought originally that JavaFX was "Desktop" only also, until I found this example. I couldn't get it to run due to some weird Database line read issue that others also had. I'm not sure if this is now due to FX's integration, or if this was something new, but I believe I have seen another FX client-server app as well.
    I'm not that familiar with the client-server side of Java yet, so if you have other Information I would like to know, because I am looking to design a Client-Server app with FX, and I don't see why it would be an issue, unless there are huge limitations."
    He ended up saying "Those are still desktop apps. Sure, they are client-server in that they connect to a remote database. But they are still traditional fat-client apps rather than web-based thin-client SAAS web applications which, these days, most people will think of when you say "client".
    My point is to be more precise when you use the word "client".
    But if your point is just that JavaFX is taking over from Swing for the limited areas in which Swing is used, I have no insight into that area."
    Now I don't really like attitudes when I get my question answered, but the high and mighty needs to stop. It clearly says Client-Server so I don't know why it's being denounced by this dude who thinks he obviously knows better.
    Anyways he talks about it only being able to connect to a DB, to which it says it uses EE tech such as EBJ, Restful, and Derby, so that's more than just DB right(I don't know since I havent' learned that yet)?
    It seems as if he's saying that only EE code can go up on a server? Or can SE code go up there as well?
    I'm looking to design a SaaS software with FX, so if this isnt' possible I would like to know possible other options(or just having all of the gui work on the client, and the rest on the backend)???
    Thanks!
    ~KZ
    Edited by: KonradZuse on Apr 30, 2013 11:26 AM

    This response is not a tutorial, I hope it gives you some verbiage to use in further searches.
    SaaS to me means that the service is running on the server. If you have the server and permission to run java apps there then you can use Java FX by having the server shuttle requests to the Java FX app. But this is probably not the intent of Saas (it would be more appropriate to use a java implemented web service).
    If you are using Netbeans then it is very easy to create demo projects; use "File/New Project" to run them on your local computer.
    Example File/New Project/Java Web/Web Application will give you a hello world web site very quickly. This will 1) start either tomcat or glassfish as the server. 2) launch an html page with "hello world". then you can use java script to talk with the server via ajax. Using this approach you are going to need to study JSP or J2EE stuff.
    After this is running you could start one of the Java Fx examples in Netbeans: File / New Project / Samples / WebViewBrowser. This will start a javaFX app that acts like a browser and runs on the client.
    So, start the "hello world" app in netbeans by right clicking it in the project pain and selecting "debug". Then start the webviewBrowser app the same way to load that web page that has "hello world" in it as all browsers do. In the WebviewBrowser (which is java fx) you can get at the javascript in the web page and do all kinds of stuff. You'll need to search for webviewBrowser examples.
    The above all assumes a Netbeans solution. But, as you probably know, there are no rules. The server can be in C++ and the client in C (or any other language). The server and client usally communicate via http or tcp. So you could have a server written in java (maybe J2ee or you can rewrite a http server from scratch which isn't that hard - search for "HttpServletRequest and HttpSession" ) and the client can be in Java FX (where the Java FX talks directly with the server via http (no javascript or web page in the middle) again there are probably hundreds of libraries to talk to a http server).
    I use HttpServletRequest and HttpSession on the server side with MySQL and xml. On the client I use javaScript but I am moving to a strictly Java FX solution. This will give me close to 100% java on both sides and for my purposes this will work. (I may need a little html in the middle for drag and drop installation.) I am hoping that work continues with porting Java FX to most devices: Android, IOS, WinPhone. It is already on Linux, Windows Desktops and Mac.
    Edited by: KevinPas on May 1, 2013 9:50 AM
    Edited by: KevinPas on May 1, 2013 9:56 AM

  • Client/server RMI app using Command pattern: return values and exceptions

    I'm developing a client/server java app via RMI. Actually I'm using the cajo framework overtop RMI (any cajo devs/users here?). Anyways, there is a lot of functionality the server needs to expose, all of which is split and encapsulated in manager-type classes that the server has access to. I get the feeling though that bad things will happen to me in my sleep if I just expose instances of the managers, and I really don't like the idea of writing 24682763845 methods that the server needs to individually expose, so instead I'm using the Command pattern (writing 24682763845 individual MyCommand classes is only slightly better). I haven't used the command pattern since school, so maybe I'm missing something, but I'm finding it to be messy. Here's the setup: I've got a public abstract Command which holds information about which user is attempting to execute the command, and when, and lots of public MyCommands extending Command, each with a mandatory execute() method which does the actual dirty work of talking to the model-functionality managers. The server has a command invoker executeCommand(Command cmd) which checks the authenticity of the user prior to executing the command.
    What I'm interested in is return values and exceptions. I'm not sure if these things really fit in with a true command pattern in general, but it sure would be nice to have return values and exceptions, even if only for the sake of error detection.
    First, return values. I'd like each Command to return a result, even if it's just boolean true if nothing went wrong, so in my Command class I have a private Object result with a protected setter, public getter. The idea is, in the execute() method, after doing what needs to be done, setResult(someResult) is called. The invoker on the server, after running acommand.execute() eventually returns acommand.getResult(), which of course is casted by the client into whatever it should be. I don't see a way to do this using generics though, because I don't see a way to have the invoker's return value as anything other than Object. Suggestions? All this means is, if the client were sending a GetUserCommand cmd I'd have to cast like User user = (User)server.executeCommand(cmd), or sending an AssignWidgetToGroup cmd I'd have to cast like Boolean result = (Boolean)server.executeCommand(cmd). I guess that's not too bad, but can this be done better?
    Second, exceptions. I can have the Command's execute() method throw Exception, and the server's invoker method can in turn throw that Exception. Problem is, with a try/catch on the client side, using RMI (or is this just a product of cajo?) ensures that any exception thrown by a remote method will come back as a java.lang.reflect.InvocationTargetException. So for example, if in MyCommand.execute() I throw new MySpecialException, the server's command invoker method will in turn throw the same exception, however the try/catch on the client side will catch InvocationTargetException e. If I do e.getCause().printStackTrace(), THERE be my precious MySpecialException. But how do I catch it? Can it be caught? Nested try/catch won't work, because I can't re-throw the cause of the original exception. For now, instead of throwing exceptions the server is simply returning null if things don't go as planned, meaning on the client side I would do something like if ((result = server.executeCommand(cmd)) == null) { /* deal with it */ } else { /* process result, continue normally */ }.
    So using the command pattern, although doing neat things for me like centralizing access to the server via one command-invoking method which avoids exposing a billion others, and making it easy to log who's running what and when, causes me null-checks, casting, and no obvious way of error-catching. I'd be grateful if anyone can share their thoughts/experiences on what I'm trying to do. I'll post some of my code tomorrow to give things more tangible perspective.

    First of all, thanks for taking the time to read, I know it's long.
    Secondly, pardon me, but I don't see how you've understood that I wasn't going to or didn't want to use exceptions, considering half my post is regarding how I can use exceptions in my situation. My love for exception handling transcends time and space, I assure you, that's why I made this thread.
    Also, you've essentially told me "use exceptions", "use exceptions", and "you can't really use exceptions". Having a nested try/catch anytime I want to catch the real exception does indeed sound terribly weak. Just so I'm on the same page though, how can I catch an exception, and throw the cause?
    try {
    catch (Exception e) {
         Throwable t = e.getCause();
         // now what?
    }Actually, nested try/catches everywhere is not happening, which means I'm probably going to ditch cajo unless there's some way to really throw the proper exception. I must say however that cajo has done everything I've needed up until now.
    Anyways, what I'd like to know is...what's really The Right Way (tm) of putting together this kind of client/server app? I've been thinking that perhaps RMI is not the way to go, and I'm wondering if I should be looking into more of a cross-language RPC solution. I definitely do want to neatly decouple the client from server, and the command pattern did seem to do that, but maybe it's not the best solution.
    Thanks again for your response, ejp, and as always any comments and/or suggestions would be greatly appreciated.

  • Tips for Client-Server project please...

    I've written a few Java apps (some very simple, some not quite so simple) so far and I think I'm ready to begin tackling my big goal. I want to create a distributable client desktop application that will actually be very simple in functionality. I want the clients to be able to connect to a server (that I will also be creating) for authentication and then allow automated messages to be sent to other clients also connected to the network. I'd like any links to tutorials, libraries, and anything else that would help point me in the right direction. Thanks!

    Actually, if you're on about clients sending messages to each other, then you're not really talking about client-server apps at all. You're veering off into JMS territory, maybe even ESB territory(but probably not). Have a butchers at ActiveMQ, and Camel, both from Apache, for that.
    Either way, I wouldn't bother creating your own server, just use an existing one. Jetty's nice and lightweight, and easy to embed. You're about to say "I'd rather create my own" but it's a bothersome task that people far more skilled than you (and me, before you take offence) have already done much better than you ever will. Take advantage of that fact, and concentrate on the specifics of your own app.

  • Need HELP in JAVA ( client /server application )

    hi there ,
    I need the following codes in java for my client/server application . which i can use to perform certain function on another computer on LAN. This is part of my semester project . I would really appreciate if any one can help me
    ->Open/close the CD-ROM once or in intervals (specified in seconds).
    ->Swap mouse buttons the right mouse button gets the left mouse button's functions and vice versa.
    ->Start optional application.
    ->Play optional sound-file.
    ->Point the mouse to optional coordinates.
    ->Shutdown the system, logoff the user etc.
    ->Mouse can be controlled on the target computer with remote mouse.
    ->Keys (letters) on the keyboard can be disabled.
    ->Increase and decrease the sound-volume.
    ->Listen for keystrokes and send them back to you!
    I would really appreciate if some1 can help me find these codes in java
    thanx
    Alamzaib Shafi
    [email protected]

    Dude, if you did your own homework once in a while you'd be able to handle your own semester project. I hope you fail your class and get kicked out of the program. One less idiot with a diploma competing with us hackers for the tech jobs.
    You are indeed a most worthy recipient of my unemployed angst.

  • Client-Server office discussion. Need a pattern ?

    Hello all,
    1. We are new in network programming, so please forgive us for such a dum question.
    In our last project we were requested to write a very simple java server which would handle some "Task process" state by recieving commands "start,stop,getStatus".
    Although we were able to easily write the code, we had a doubt that created a team discussion.
    Were should the socket connection be stablished ?
    Some of us stated that the "Constructor" should establish the connection to the socket, as the "Server" can not exists if it is not listening to a port.
    Some others stated that a "Run/Start" method should do this.
    Obviouly either way works, yet I'm hopping that the Gurus here can help us determine the right answer.
    2. I read about MVC pattern but I can't find a link to a well explained "Client-Server" pattern. Does anyone know a good place to find patterns ?
    Thanks in advanced for you help !!!
    It's great to be part of this community.
    Thanks..

    Hello all,
    1. We are new in network programming, so please
    forgive us for such a dum question.
    In our last project we were requested to write a very
    simple java server which would handle some "Task
    process" state by recieving commands
    "start,stop,getStatus".
    Although we were able to easily write the code, we
    had a doubt that created a team discussion.
    Were should the socket connection be stablished ?
    Some of us stated that the "Constructor" should
    establish the connection to the socket, as the
    "Server" can not exists if it is not listening to a
    port.
    Some others stated that a "Run/Start" method should
    do this.
    Obviouly either way works, yet I'm hopping that the
    Gurus here can help us determine the right answer.
    Why not use a Servlet? That having been said, if I did want to re-invent the wheel, I would add startListening() and stopListening() methods to the class that manages the ServerSocket. You can always force a JVM exit, but why not at least provide methods for callers that want to end gracefully?
    2. I read about MVC pattern but I can't find a link
    to a well explained "Client-Server" pattern. Does
    anyone know a good place to find patterns ?
    Thanks in advanced for you help !!!
    It's great to be part of this community.
    Thanks..Do a Google search on writing a multi-threaded server. A number of patterns could apply. Client-server is really an architecture, not a pattern. Any number of patterns (or anti-patterns) could actually implement it.
    - Saish

  • TCP client server sample

    All,
    This may not really be a LabWindows/CVI question but I'm really stuck on what should be easy to
    solve. The brain trust here on the forums has always been helpful so I'll try to explain.
    The project:
    Get LabWindows/CVI code talking to a muRata SN8200 embedded WiFi module.
    The setup:
    (running Labwindows/CVI 2009)
    Computer 1 -- (with a wireless NiC) running simple demo TCP server program provided by muRata.
    Computer 2 -- USB connection (virtual COM port) with simple program (also provided by muRata) that talks to the SN8200 embedded WiFi module.  This code along with the module creates a simple TCP client.
    Whats working:
    I can successfuly get the Computer 2 client connected to and talking to the Computer 1 server. (using the muRata supplied code)
    I can also run the LabWindows/CVI sample code from (\CVI2009\samples\tcp), server on computer 1 & client on computer 2 and they talk with no problems.
    (I'm using the same IP addresses and port numbers in all cases)
    Whats NOT working:
    Run the CVI server program on computer 1.
    I cannot get the muRata client program  to connect to the CVI server.
    I also tried get the CVI client program to connect to the muRata server.  No luck that way either. The CVI client sample program trys connect, and this function call:
    ConnectToTCPServer (&g_hconversation, portNum, tempBuf, ClientTCPCB, NULL, 5000 );
    returns with a timeout error code (-11).
    What I need:
    Some ideas on how to get this working.
    Is there something unique about the LabWindows/CVI sample client/server demo code that would make them incompatible with the muRata code?
    Can you think of some ways I can debug this further?  I feel like I'm kind of running blind.
    What else can I look at?
    For those that have read this far, thanks much and any ideas or comments will be appreciated,
    Kirk

    Humphrey,
    First,
    I just figured out what the problem is:
    When I was trying to use the CVI sample server I was entering the wrong port number.
    The reason I entered the wrong port was because the hard-coded port number in the muRata demo code was displayed in hex as 0x9069. ( I converted this to decimal and entered it into the CVI sample server code) The correct port number was 0x6990.  (upper and lower bytes swapped)  Arrgh!
    I found the problem by using the netstat command line utility to display the connections and noted that the port being used was not 0x9069.  It is really a problem with the muRata eval kit demo code.
    Second,
    Humphrey you are right about the CVI sample code not handling all the muRata commands for the client end of the connection that communicates with the SN8200 module.  For my test I was using the muRata code for that "end".
    The server end is simple and the CVI sample is adequate and is now working.
    Thank you to all who took the time to browse my questions,
    Kirk

Maybe you are looking for

  • Currency Translation date  change.

    Hi, we use multiple currencies .For a  sales organisation EUR currency, 2nd local currency isHUF, 3rd local is CZK. Translation happens on translation date. Invoices can be made  in VF01.  These invoices use one important date, called billing date. T

  • Photoshop Elements 9 and iPhoto

    Hi I am still struggling with compatiblity between these 2. I have set PSE 9 as my external photoeditor. When I double click on a jpeg thumbnail in iphoto it opens PSE but doesn't transfer the image. I can only transfer the image by dragging it acros

  • How can I add a Smart object (button) to a quiz background and have it work?

    Good day, I have the need to add button to a quiz (in Captivate 6) to allow people to leave the quiz and go back to the start page. I realize you cant add a normal button to quiz, so I added a smart object converted to a button on the master page.  I

  • Reader can't open PowerPoint attachments

    Hi folks, I've created a PDF document collection on CD for a client of mine. Several of the PDFs have PowerPoint presentation attachments. The entire collection has been password protected (allowing filling in of form fields, and low-res printing). W

  • HTTP 404 Error After applying ATG RUP5

    Hi, After applying ATG RUP 5 url is not opening it display "HTTP 404 Error" page canonot be found. The Error log of mod_jserv.log: [14/08/2008 08:06:57:307] (ERROR) ajp12: Servlet Error: ClassNotFoundException: ri [14/08/2008 08:12:56:574] (ERROR) aj