Difference between RMI and Java Beans
Hello
I have to develop a program that allow the users to have access to the Patient information . The program will also organize appointment between the users and the patients. + extra thing like agenda .....
I will have about 10 to 20 user that will have access at the same time to the same info .
My question is :what is the best solution for such kind of programes
RMI :after searching in google (it is light weight )
java beans:more powerful than RMI
or maybe thread ???
any one can explain the difference please ?
Thank you
A little [url http://www.google.ca/search?hl=en&q=rmi+ejb&btnG=Google+Search&meta=]google with keywords: rmi ejb would give all the answers you need.
Specifically you could read [url http://www.devx.com/Java/Article/20843/0/page/1]the article from the first result: EJB and RMI: A Practical Introduction.
Also there are many threads from these forums that already answered your question in the past.
Here is one: [url http://forum.java.sun.com/thread.jspa?threadID=539544&messageID=2613399]Rmi and EJB.
Happy reading!
Regards
Similar Messages
-
Difference Betn EJB and Java Bean
what is diference between EJB and Java Bean...???
Is it really necessary to ask the same thing twice??
MeTitus -
Difference between RMI and NET
Hi
when i have to use java.rmi and java.net
or when i have to use socket programming
and when i have to use java.rmiHi
when i have to use java.rmi and java.net
or when i have to use socket programming
and when i have to use java.rmi -
Difference between ooabap and java
eventhough both java and ooabap are oops languages there may be some difference between them as c++ and java in using the oops concepts or may be there is an advantage in using ooabap than java .
any one pls reply to the above asked question.
<REMOVED BY MODERATOR>
Edited by: rahul nuthi on Feb 26, 2008 1:10 PM
Edited by: Alvaro Tejada Galindo on Feb 26, 2008 11:19 AMhi
OOPs ABAP uses Classes and Interfaces which uses Methods and events.
If you have Java skills it is advantage for you.
There are Local classes as well as Global Classes.
Local classes we can work in SE38 straight away.
But mostly it is better to use the Global classes.
Global Classes or Interfaces are to be created in SE24.
SAP already given some predefined classes and Interfaces.
This OOPS concepts very useful for writing BADI's also.
So first create a class in SE 24.
Define attributes, Methods for that class.
Define parameters for that Method.
You can define event handlers also to handle the messages.
After creation in each method write the code.
Methods are similar to ABAP PERFORM -FORM statements.
After the creation of CLass and methods come to SE38 and create the program.
In the program create a object type ref to that class and with the help of that Object call the methods of that Class and display the data.
Example:
REPORT sapmz_hf_alv_grid .
Type pool for icons - used in the toolbar
TYPE-POOLS: icon.
TABLES: zsflight.
To allow the declaration of o_event_receiver before the
lcl_event_receiver class is defined, decale it as deferred in the
start of the program
CLASS lcl_event_receiver DEFINITION DEFERRED.
G L O B A L I N T E R N A L T A B L E S
*DATA: gi_sflight TYPE STANDARD TABLE OF sflight.
To include a traffic light and/or color a line the structure of the
table must include fields for the traffic light and/or the color
TYPES: BEGIN OF st_sflight.
INCLUDE STRUCTURE zsflight.
Field for traffic light
TYPES: traffic_light TYPE c.
Field for line color
types: line_color(4) type c.
TYPES: END OF st_sflight.
TYPES: tt_sflight TYPE STANDARD TABLE OF st_sflight.
DATA: gi_sflight TYPE tt_sflight.
G L O B A L D A T A
DATA: ok_code LIKE sy-ucomm,
Work area for internal table
g_wa_sflight TYPE st_sflight,
ALV control: Layout structure
gs_layout TYPE lvc_s_layo.
Declare reference variables to the ALV grid and the container
DATA:
go_grid TYPE REF TO cl_gui_alv_grid,
go_custom_container TYPE REF TO cl_gui_custom_container,
o_event_receiver TYPE REF TO lcl_event_receiver.
DATA:
Work area for screen 200
g_screen200 LIKE zsflight.
Data for storing information about selected rows in the grid
DATA:
Internal table
gi_index_rows TYPE lvc_t_row,
Information about 1 row
g_selected_row LIKE lvc_s_row.
C L A S S E S
CLASS lcl_event_receiver DEFINITION.
PUBLIC SECTION.
METHODS:
handle_toolbar FOR EVENT toolbar OF cl_gui_alv_grid
IMPORTING
e_object e_interactive,
handle_user_command FOR EVENT user_command OF cl_gui_alv_grid
IMPORTING e_ucomm.
ENDCLASS.
CLASS lcl_event_receiver IMPLEMENTATION
CLASS lcl_event_receiver IMPLEMENTATION.
METHOD handle_toolbar.
Event handler method for event toolbar.
CONSTANTS:
Constants for button type
c_button_normal TYPE i VALUE 0,
c_menu_and_default_button TYPE i VALUE 1,
c_menu TYPE i VALUE 2,
c_separator TYPE i VALUE 3,
c_radio_button TYPE i VALUE 4,
c_checkbox TYPE i VALUE 5,
c_menu_entry TYPE i VALUE 6.
DATA:
ls_toolbar TYPE stb_button.
Append seperator to the normal toolbar
CLEAR ls_toolbar.
MOVE c_separator TO ls_toolbar-butn_type..
APPEND ls_toolbar TO e_object->mt_toolbar.
Append a new button that to the toolbar. Use E_OBJECT of
event toolbar. E_OBJECT is of type CL_ALV_EVENT_TOOLBAR_SET.
This class has one attribute MT_TOOLBAR which is of table type
TTB_BUTTON. The structure is STB_BUTTON
CLEAR ls_toolbar.
MOVE 'CHANGE' TO ls_toolbar-function.
MOVE icon_change TO ls_toolbar-icon.
MOVE 'Change flight' TO ls_toolbar-quickinfo.
MOVE 'Change' TO ls_toolbar-text.
MOVE ' ' TO ls_toolbar-disabled.
APPEND ls_toolbar TO e_object->mt_toolbar.
ENDMETHOD.
METHOD handle_user_command.
Handle own functions defined in the toolbar
CASE e_ucomm.
WHEN 'CHANGE'.
PERFORM change_flight.
LEAVE TO SCREEN 0.
ENDCASE.
ENDMETHOD.
ENDCLASS.
S T A R T - O F - S E L E C T I O N.
START-OF-SELECTION.
SET SCREEN '100'.
*& Module USER_COMMAND_0100 INPUT
MODULE user_command_0100 INPUT.
CASE ok_code.
WHEN 'EXIT'.
LEAVE TO SCREEN 0.
ENDCASE.
ENDMODULE. " USER_COMMAND_0100 INPUT
*& Module STATUS_0100 OUTPUT
MODULE status_0100 OUTPUT.
DATA:
For parameter IS_VARIANT that is sued to set up options for storing
the grid layout as a variant in method set_table_for_first_display
l_layout TYPE disvariant,
Utillity field
l_lines TYPE i.
After returning from screen 200 the line that was selected before
going to screen 200, should be selected again. The table gi_index_rows
was the output table from the GET_SELECTED_ROWS method in form
CHANGE_FLIGHT
DESCRIBE TABLE gi_index_rows LINES l_lines.
IF l_lines > 0.
CALL METHOD go_grid->set_selected_rows
EXPORTING
it_index_rows = gi_index_rows.
CALL METHOD cl_gui_cfw=>flush.
REFRESH gi_index_rows.
ENDIF.
Read data and create objects
IF go_custom_container IS INITIAL.
Read data from datbase table
PERFORM get_data.
Create objects for container and ALV grid
CREATE OBJECT go_custom_container
EXPORTING container_name = 'ALV_CONTAINER'.
CREATE OBJECT go_grid
EXPORTING
i_parent = go_custom_container.
Create object for event_receiver class
and set handlers
CREATE OBJECT o_event_receiver.
SET HANDLER o_event_receiver->handle_user_command FOR go_grid.
SET HANDLER o_event_receiver->handle_toolbar FOR go_grid.
Layout (Variant) for ALV grid
l_layout-report = sy-repid. "Layout fo report
Setup the grid layout using a variable of structure lvc_s_layo
Set grid title
gs_layout-grid_title = 'Flights'.
Selection mode - Single row without buttons
(This is the default mode
gs_layout-sel_mode = 'B'.
Name of the exception field (Traffic light field) and the color
field + set the exception and color field of the table
gs_layout-excp_fname = 'TRAFFIC_LIGHT'.
gs_layout-info_fname = 'LINE_COLOR'.
LOOP AT gi_sflight INTO g_wa_sflight.
IF g_wa_sflight-paymentsum < 100000.
Value of traffic light field
g_wa_sflight-traffic_light = '1'.
Value of color field:
C = Color, 6=Color 1=Intesified on, 0: Inverse display off
g_wa_sflight-line_color = 'C610'.
ELSEIF g_wa_sflight-paymentsum => 100000 AND
g_wa_sflight-paymentsum < 1000000.
g_wa_sflight-traffic_light = '2'.
ELSE.
g_wa_sflight-traffic_light = '3'.
ENDIF.
MODIFY gi_sflight FROM g_wa_sflight.
ENDLOOP.
Grid setup for first display
CALL METHOD go_grid->set_table_for_first_display
EXPORTING i_structure_name = 'SFLIGHT'
is_variant = l_layout
i_save = 'A'
is_layout = gs_layout
CHANGING it_outtab = gi_sflight.
End of grid setup
Raise event toolbar to show the modified toolbar
CALL METHOD go_grid->set_toolbar_interactive.
Set focus to the grid. This is not necessary in this
example as there is only one control on the screen
CALL METHOD cl_gui_control=>set_focus EXPORTING control = go_grid.
ENDIF.
ENDMODULE. " STATUS_0100 OUTPUT
*& Module USER_COMMAND_0200 INPUT
MODULE user_command_0200 INPUT.
CASE ok_code.
WHEN 'EXIT200'.
LEAVE TO SCREEN 100.
WHEN'SAVE'.
PERFORM save_changes.
ENDCASE.
ENDMODULE. " USER_COMMAND_0200 INPUT
*& Form get_data
FORM get_data.
Read data from table SFLIGHT
SELECT *
FROM zsflight
INTO TABLE gi_sflight.
ENDFORM. " load_data_into_grid
*& Form change_flight
Reads the contents of the selected row in the grid, ans transfers
the data to screen 200, where it can be changed and saved.
FORM change_flight.
DATA:l_lines TYPE i.
REFRESH gi_index_rows.
CLEAR g_selected_row.
Read index of selected rows
CALL METHOD go_grid->get_selected_rows
IMPORTING
et_index_rows = gi_index_rows.
Check if any row are selected at all. If not
table gi_index_rows will be empty
DESCRIBE TABLE gi_index_rows LINES l_lines.
IF l_lines = 0.
CALL FUNCTION 'POPUP_TO_DISPLAY_TEXT'
EXPORTING
textline1 = 'You must choose a line'.
EXIT.
ENDIF.
Read indexes of selected rows. In this example only one
row can be selected as we are using gs_layout-sel_mode = 'B',
so it is only ncessary to read the first entry in
table gi_index_rows
LOOP AT gi_index_rows INTO g_selected_row.
IF sy-tabix = 1.
READ TABLE gi_sflight INDEX g_selected_row-index INTO g_wa_sflight.
ENDIF.
ENDLOOP.
Transfer data from the selected row to screenm 200 and show
screen 200
CLEAR g_screen200.
MOVE-CORRESPONDING g_wa_sflight TO g_screen200.
LEAVE TO SCREEN '200'.
ENDFORM. " change_flight
*& Form save_changes
Changes made in screen 200 are written to the datbase table
zsflight, and to the grid table gi_sflight, and the grid is
updated with method refresh_table_display to display the changes
FORM save_changes.
DATA: l_traffic_light TYPE c.
Update traffic light field
Update database table
MODIFY zsflight FROM g_screen200.
Update grid table , traffic light field and color field.
Note that it is necessary to use structure g_wa_sflight
for the update, as the screen structure does not have a
traffic light field
MOVE-CORRESPONDING g_screen200 TO g_wa_sflight.
IF g_wa_sflight-paymentsum < 100000.
g_wa_sflight-traffic_light = '1'.
C = Color, 6=Color 1=Intesified on, 0: Inverse display off
g_wa_sflight-line_color = 'C610'.
ELSEIF g_wa_sflight-paymentsum => 100000 AND
g_wa_sflight-paymentsum < 1000000.
g_wa_sflight-traffic_light = '2'.
clear g_wa_sflight-line_color.
ELSE.
g_wa_sflight-traffic_light = '3'.
clear g_wa_sflight-line_color.
ENDIF.
MODIFY gi_sflight INDEX g_selected_row-index FROM g_wa_sflight.
Refresh grid
CALL METHOD go_grid->refresh_table_display.
CALL METHOD cl_gui_cfw=>flush.
LEAVE TO SCREEN '100'.
ENDFORM. " save_changes
chk this blog
/people/vijaybabu.dudla/blog/2006/07/21/topofpage-in-alv-using-clguialvgrid
/message/4447073#4447073 [original link is broken]
Difference between ABAP an OOABAP
http://en.wikipedia.org/wiki/Comparison_of_ABAP_and_Java
hope it will help you
regards
sreelatha gullapalli -
What is the difference between RMI and JAX-RPC?
Dear All
First of all my understanding of RMI and JAX-RPC:
RMI is JAVA only version of RPC. It can't talk to any other language.
JAX-RPC is a part of JWSDP and if you implement your client and server with JAX-RPC, client written in any language can talk with JAX-RPC implementation.
What else makes them different and am I right with my understanding?
Finally, I would like to develop clients which will have a java class, say httpserver.java, which will act like a http server, listens to a http port. Now, Two such client will run in two different PC and I want to call a module from one client to another which should be accessible via my httpserver.java. For that which should be my choice RMI or JAX-RPC? Can I achive it with http get-post method, as I am expecting to read some value of variables from one client to the another.
Say class A has variable a, aa, aaa and clas B has variable b, bb, bbb. Now I want to read the value of b, bb, bbb from class A. How do I do that when class B is listening to a http port with my httpserver.java class.
Lastly, say B is listening to a http port and I want to send a file to B from A. How can I do that? Remember, B didn�t ask for that. How can A send a file to B when B is listening to a http port with my httpserver.java.
With regards
Mohammed Jubaer Arif
Mobile: +61-0411215302
Personal Web: http://www.geocities.com/jubairarifctg/
Org. Web.: http://www.geocities.com/halimschamber/simply put, RMI allows you to (semi) transparently treat remote objects as if they were local, and your distributed application can be written (more or less) like a "normal" java app. Sockets just give you a "raw" connection to work with, and you get to build up your application from that.
I hope that helped
Lee -
Differences between servlet and backing bean
Could anyone please tell me whether everywhere that servlet can be used, backing bean and JSF can be used too? Are JSF and backing beans the new alternatives for JSP and servlets? please clarify the relations between these concepts for me.
Thanks
LauraLaura_Jlover wrote:
Thank you. You mean backing beans can do every thing that servlets can do? Yes.
JSF pages can work with servlets? Strictly speaking, every JSF page gets passed through the FacesServlet which does all the task. The lifecycle, creating the FacesContext, putting the request parameters in backing beans, rendering the response, etcetera.
what are the advantages of servlet and the advantages of backing beans? what's the disadvantages? In general, which one is better?In context of JSF, you should be using backing beans, not Servlets. There is nothing what a Servlet can offer you as an advantage in the JSF context. It is simply not an option/alternative. You can't even call a Servlet (directly) using a JSF h:form. You, however, can access backing beans in any JSP or Servlet outside the JSF context.
Just carefully read the JSF specification or buy a JSF book and the picture will be clear.
JSF spec: [http://jcp.org/aboutJava/communityprocess/final/jsr252/index.html].
JSF book: [http://www.amazon.com/JavaServer-Faces-Complete-Reference/dp/0072262400]. -
Testing SSL Connections, differences between ABAP and JAVA stacks
Hello,
I am trying to test an outbound SSL connection to a partner. I already have multiple outbound connections to many partners, but this new one is causing an issue. Our firewalls between the two sites are opened as required, I verified that I can telnet to the 443 port of their sever. I then attempted to connect to their URL, via a Java SOAP message, and it is rejected. Some kind of error regarding our handshake.
In an attempt to troubleshoot the issue I entered their URL in SM59 as a HTTPS connection, tested it, it worked fine. Which indicates to me that the ABAP side works fine.
I do the same on the Java stack, via the SOA Manager: Destinations, and it fails.
"Error during ping operation: Error while silently connecting org.w3c.www.protocol.http.Http.Eception: Peer sent alert: Alert Fatal: unexpected message"
I was thinking that maybe the remote partner only allows specific types of SSL version connection, and the Java side is too low. i.e. the partner only allows TLS v1, and we are attempting to use SSL v2. Is there a place to set this on the Java side? I know I can set inbound parameters on ICM via SMICM.
Any help or assistance would be most appreciated.
Thanks,
Michael MontoneHi,
I suggest that you verify if you use the same release of the SAP Cryptolib for the ABAP and the Java stack.
This could explain a difference of support for SSL or TLS.
Regards,
Olivier -
Basic difference between stateful and entity beans???
Could anyone please explain the basic diff between stateful bean and an entity bean.as per my understanding,stateful beans are extensions to clients.they perform a job of a client and they r not persistent.also their state goes off when the server crashes or the machine is reeboted.while in contrast,an entity bean can retain its session coz' they represent a persistent field in the DB.What i have seen in few books(O'reilly,etc)where a session bean can insert some values into the DB,which means it also represents a persistent object in the DB,which contradicts the statement that "stateful session beans dont represent any persistent object in the DB".Could anyone please elaborate on this.Thanks in advance.
JameelThank u very much crackers for ur valuable
suggestions.I'll throw a different one in here for free: clarity of writing is a highly-valued and useful skill in a software professional. This is especially true these days when concepts need to be clearly explained to a variety of technical peoples from all over the world. And then there's the other side of the coin: Management.
You have to get your thoughts across in a very precise manner and, unfortunately for those who have to learn it as a second lanugage, English seems to be the overall preferred medium. Which makes it even more important to use "correct" English in written communications. If you don't, your credibility diminishes and you appear to be (horrors!) unprofessional It's not that much harder to type "you" than it is to use a single letter. Besides, most people that "pay by the byte" appreciate the clarity, as well (as I've seen on Usenet, by way of covering my ass).
Now, back to our regularly scheduled post...
Is this wat u were trying to say if i
understood u correctly.Yes, the EntityBean is directly related to the data being persisted: in this case, a database table. So, using your example from below, the DB table would have two fields: a VARCHAR 'Name' and an INT 'Age.' The EntityBean would have corresponding fields/properties/variables, String name and int age.
"WHICH BEAN (Entity
or Sateful Session) SHOULD I GO 4???"No easy answer. The best one is: it depends. On what? It depends upon what you're trying to do with the data, how it's presented/manipulated, load requirements, environmental requirements, caching strategies, and about another dozen or so other high-level requirements.
My personal preference is if I need caching and the number of EntityBeans actually in existence is pretty "low" (another nebulous and arbitrary value, depending), I'll use a StatelessSessionBean as a Facade (search for "patterns" here in the forum), with the persistence in CMP EntityBeans. Which is influenced by the fact that I like playing with CMP. ;D -
Difference between "javaw" and "java"
When running my code using "javaw.exe" supplied with JDeveloper 3.1, I kept getting "java.lang.NullPointerException" errors. However, it runs perfectly using Sun's "java.exe" (v 1.3.0).
Why the difference?Here's the code: the error occurs in the line " proc.processXSL(transform,source,transformResult);". However, this is part of a method that is called from main() - and is called several times during a for loop. The first time it works perfectly, the second time it fails gracefully, the third time (and subsequent times) it sometimes fails to report an exception! Note also that main() calls the method with exactly the same parameters, and the method is doing exactly the same thing every time.
Code:
String theXSL = "/mt565.xsl";
// Parse the string as an XML document
DOMParser theParser = new DOMParser();
theParser.parse(new java.io.StringReader(XMLClob));
XMLDocument source = theParser.getDocument();
// get the stylesheet and transform
URL url = swiftMessage.class.getResource(theXSL);
XSLStylesheet transform = new XSLStylesheet(url,url);
XSLProcessor proc = new XSLProcessor();
String fn = "////d://xmlMessage//mt565_result.txt";
transformResult = new FileOutputStream(fn); // File name for output
proc.processXSL(transform,source,transformResult);
Graham -
Differences between "javaw" and "java -jar"
I am making an installer. The installer is packaged in a jar. It creates a jar file that contains the content to be installed and appropriate extractor classes. When I execute the jar using the command line, I can use two different commands:
"javaw myJar.jar"
OR
"java -jar myJar.jar"
When I use javaw, I get a message box saying no main class is found. When I use java -jar, the installer runs normally. When I d-click the installer jar, and try to make a jar a dos window opens up with the header "c:\jdk1.3.1\bin\jar.exe" and does nothing from that point on. It will close normally though.
Thanks!!
Jason R. KretzerThe javaw (java window) is almost identical to "java (java console)" command, except never produces any output text since the javaw has no associated console window. It means that you cannot use any options that are supposed to work with information output in text form or produces text output. However, if you get an error during your application lunch or runtime error you will get a dialog box with error information. (ref: http://www.javafaq.nu/java-article1077.html)
Helpful steps using Windows XP SP2:
1. Go to Tools | Folder Options... | File Types Tab | JAR | Select 'Advanced' button
2. "Edit File Type Window" will pop up
3. In the "Actions:" panel, select open | Edit...
4. Change "Application used to perform action:" text field from
C:\Program Files\Oracle\JInitiator 1.3.1.22\bin\javaw.exe -jar %1
to
"C:\Program Files\Java\jdk1.6.0_05\bin\javaw.exe" -jar "%1" -
What are the MAJOR Differences between C++ and Java?
What is it?
You can ask the question but will you understand the answer? How newbie are you?
-
difference between rmi and ejb
i asked differences only u dont know plz keep
silentYou don't know it either. I don't see anything wrong with that message. The first thing to do when you have a question is search for the information already available. With these kind of messages, you are reducing your chances of getting a good reply (which is likely to be "search google")
why forum mr reflex2javaPlease use complete sentences that make sense to English speakers. -
Difference btwn RMI and Network prog.
Hello to all,
iam currently learning RMI and pls tell me what is the difference between RMI and Network Programming(using sockets....)
Thanx in advance.RMI sits on top of sockets and basically lets you send objects over the wire. Network programming is underneath and it handles all the transmission issues.
-
What's the difference between using java directly in JSP and java bean
What is the difference if I use java code directly in JSP or use java bean in JSP?
Which class to use for receiving the passed parameter from html or java script? Any difference for java code and java bean in the way receiving the passed data?
How can I pass string from jsp to html or java script?1 Cleaner pages
2 you have to write the class and use set and get methods
3 What do you mean when saying passing string from jsp to html??, do you mean the value you can use <%=variablename%> -
Difference between RMI-IIOP and CORBA-IIOP
Hello,
What is the difference between RMI-IIOP and CORBA-IIOP?
Thanks
LarryLawrence Manickam <[email protected]> writes:
What is the difference between RMI-IIOP and CORBA-IIOP? RMI-IIOP is the protocol represented by the mapping of Java RMI
artifacts to IDL, i.e. you start with Java and use the RMI programming
model. CORBA / IIOP is really just the protocol used for IDL sourced
objects, i.e. you start with IDL and use the CORBA programming model.
andy
Maybe you are looking for
-
How to speed up 2009 Macbook Pro?
I almost pushed the button to purchase the new 13" MBP, but if I can i'd like to hold out for the 15" version so want to service my mid 2009 15" MBP until the new one is available. I downloaded the Etrecheck and here's what it says. I've deleted 3,0
-
SOAP Implementation missing methods
Hello, I am developing a document based SOAP web service and I wish to add a DOM Document to the SOAP Body. Looking at the Java 2 Platform Enterprise Edition 1.4 specification on the Sun web site I have found the following method "public SOAPBodyElem
-
ABAP System not available in SLD?
Hello, We're having a very strange problem with one of our systems in that it will not register in the SLD. It is a BW 7.0 system and RZ70 and SLDAPICUST are both configured correctly and SLDCHECK shows that everything is working as expected. Yet,
-
Question re: multiple users
I would like to allow five of my staff to use one company credit card to purchase apps. Are there corporate accounts for this purpose or can they just set up individual accounts with the same credit card? Thank you.
-
Folks, I have setup siebel with bip. When I go to the accounts screen and run the account list report - it will display fine. when I go to BIP>Reports and try to view it - it will give a genneric error. When I look at the resulting Webservices EAI OM