File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

security and performance issue with java codes

 
Prabhudatta Choudhury
Greenhorn
Posts: 20
Java
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

I have a question regarding the security and code performance of java files. I have 4 files in my webapp.

1. ui.java which is having only screem painting (coded in swing only)
2. servlet.java for server side data sending
3. BO.java contains only variables declaration with a no-arg constructor
4. Bean.java which has stateless EJB bean to connect to DB.

If I am extending the bean.java in ui.java is that going to do any performance issue or security issue there? performance and security in terms of BEAN object is being public. is there any other way to do so?

the actual purpose is I need the changing value of variable which is defined in UI.for that i have to preserve the data there in UI, transfer that to servlet through object and read that in servlet and transfer that to BEAN to write into DB.

So, What i did is: i declared a static variable in UI.assign that value to there. Extend the UI in Bean and call that static variable directly by class name and used that in bean.

Please suggest whether my approach is right or not.

<code>

UI.java

public class test
{

public static int changedvalue;

public int show()
{
changedvalue = 93;
System.out.println(changedvalue);
}

public void init()
{

//some code here for screen painting...
}
}


BEAN.java

Public class ejbBean extends UI
{

private static int oldValue = UI.changedvalue;

public static void main()
{

System.out.println("old value is " +oldValue);
}
}

</Code>

 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic