Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

we know that serialization is null,so is there any advantage using it other than ...

 
senthil sen
Ranch Hand
Posts: 184
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
we know that serialization is null,so is there any advantage using it other than Externalization??
 
Jim Yingst
Wanderer
Sheriff
Posts: 18671
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
we know that serialization is null
We do? I can't imagine what this might mean.
 
senthil sen
Ranch Hand
Posts: 184
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi jim,
Actually i was asked this question in an interview.
I said that serialization interface is an null interface, the next question he asked me was .
Q./U say that serialization is null and it serialises an object,is there any advantage in using this???
I said that since it is null,so there is no resource used when we implement this interface.
Is there any u can say about this discussion??
 
aadhi agathi
Ranch Hand
Posts: 263
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by senthil sen:
I said that serialization interface is an null interface

1. It is not a "null" interface. i mean even if it is not having any methods, the interface will inherit all the method opertation(operation is the method without implementations) of java.lang.Object's class. So, i java there is NO interface which doesn't have any operations.
2. but generally, We define interfaces, without operations to act as a "Marker". Look for Marker design pattern in the UML,Patterns forum. Also check for "contract based design by Alister cokcBurn". The "Marker" interface defines the contract (a mere presence of the type) which needs to get adhered by the implementing classes.
a "Marker" interface is a pure type and there is no "service" a.k.a operations attached with the type.

I said that since it is null,so there is no resource used when we implement this interface.

Any class (implements an interface or not ) is used to create objects and objects will hold resources(memory).
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic