In EJB ,while creating home object we often narrow it as
Context context = new InitialContext();
Object homeObject = context.lookup("Example");
ExampleHome examplehome = (ExampleHome)PortableRemoteObject.narrow(homeObject, ExampleHome.class);
Then in case of remote object instead of using the same way as
Example example = (Example)PortableRemoteObject.narrow(examplehome.create(), Example.class);
why the following way is preffered?
Example example = (Example)examplehome.create();
Is casting differs in these two case??