473,320 Members | 1,856 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Java Serializable

65
Hi All,

Can anybody give me a useful suggestion as to how i could use serializable in a simple, non GUI, netbeans driven book lending system? this would consist of only users, books and loans

I dont want any code, just ideas to get my head around how to use it in.
Nov 4 '09 #1
4 2451
jx2
228 100+
You can use serialize in many ways, i.e. instead of database system ;-) I wouldn't recommend it
any way it would look something like that:
Expand|Select|Wrap|Line Numbers
  1. class book implements serializable{
  2.  String isbn;
  3. String author;
  4. //geters and setters here
  5. }
  6.  
then you can save it on hd as an object there is nice example on wikipedia: http://en.wikipedia.org/wiki/Serialization
regards
jan
Nov 5 '09 #2
pjerald
77
"serializable" is a machanism used to pass an object to a remote server.

Consider a Hashtable or Hashmap object which has some keys and values in a java program. And you need to send this object(Note: See you need the whole object) to a remote server, how you do this?

Remember you cannot pass hashtable object as a parameter(Try this) via http request or response.

When you do integration with some web sites, you will be in need of sending objects instead of xmls or a json file as input/arguments.

In this situation, you have to serialize the object(write the object) in the response in order to send it to the remote server. Got it?


In your "book lending system", use this serialization mechanism where ever you need to write the object(as object not as a string or text) in a file.
Nov 5 '09 #3
whitep8
65
so i could simply use a database to have tables of data, but then rather than have sql make the relational inserts, i could save the object of the loans in an object file?
Nov 5 '09 #4
For socket,

To make the transaction secure, you may create an object that implements Serializable that will hold all necessary data for processing, override the uid value with any values that only you who knows about it. and to verify if it is coming from the client or worker, all you have to do is to cast the received object if it is the data carrier object or not... even if someone tries to replicate the object and used to send a malicious data to the server, you can still filter it, unless they know the uid value
Nov 6 '09 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Stacey | last post by:
I hate to start the email with the "I'm new to this clause", but there it is. I am understanding how the xsd files work and how the castor SourceGenerator works. What I am not understanding is...
2
by: Avin Patel | last post by:
Hi I have converted the code from Java to C#, using .net tool The Base Class implementes ISerializable interface. Which makes me implement this interface in all inherited class, In order to get...
458
by: wellstone9912 | last post by:
Java programmers seem to always be whining about how confusing and overly complex C++ appears to them. I would like to introduce an explanation for this. Is it possible that Java programmers...
0
by: Nata | last post by:
hi all i am trying to store the XML Document object into MS SQL2005 i want to store this as whole not different tables; plz help me regarding this i am trying form last two weeks i asked many...
15
oll3i
by: oll3i | last post by:
why it highlights new Integer(value), new Integer(newValue)); as an error import java.beans.*; import java.io.Serializable; i
15
by: Xah Lee | last post by:
On Java's Interface Xah Lee, 20050223 In Java the language, there's this a keyword “interface”. In a functional language, a function can be specified by its name and parameter specs....
0
oll3i
by: oll3i | last post by:
package library.common; import java.sql.ResultSet; public interface LibraryInterface { public ResultSet getBookByAuthor(String author); public ResultSet getBookByName(String name);
1
by: amgupta8 | last post by:
Note: This problem occurred when I updated the JDK from 1.3.1 to 1.4.1 or 1.4.2. Nothing else was changed in the code, other than updating the JDK on the database server (dbm cfg parm jdk_path) and...
0
by: hockeydave007 | last post by:
I am using jaxb to create my java class and I would like the created class to have additional attributes like: extends java.io.Serializable implements my.com.Interface <xs:complexType...
2
by: yeshello54 | last post by:
so here is my problem...in a contact manager i am trying to complete i have ran into an error..we have lots of code because we have some from class which we can use...anyways i keep getting an error...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, youll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Shllpp 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.