aspose file tools*
The moose likes Beginning Java and the fly likes what is the difference - basic Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "what is the difference - basic" Watch "what is the difference - basic" New topic
Author

what is the difference - basic

KunkalaGuntala Samba Siva Rao
Greenhorn

Joined: Nov 06, 2003
Posts: 20

[ November 10, 2003: Message edited by: Marilyn de Queiroz ]
Joe Ess
Bartender

Joined: Oct 29, 2001
Posts: 8705
    
    6


Want a better answer? Ask a better question.


"blabbing like a narcissistic fool with a superiority complex" ~ N.A.
[How To Ask Questions On JavaRanch]
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24166
    
  30

Mr Boy,
I'm sure I've explained the Java Ranch naming policy to you before. Please go here and change your display name to comply with it immediately, or I'll be forced to close your account. And I don't want to do that.


[Jess in Action][AskingGoodQuestions]
KunkalaGuntala Samba Siva Rao
Greenhorn

Joined: Nov 06, 2003
Posts: 20
Originally posted by Ernest Friedman-Hill:
Mr Boy,
I'm sure I've explained the Java Ranch naming policy to you before. Please go here and change your display name to comply with it immediately, or I'll be forced to close your account. And I don't want to do that.
KunkalaGuntala Samba Siva Rao
Greenhorn

Joined: Nov 06, 2003
Posts: 20
Originally posted by ooty boy:

sorry i am new to java, is anything not clear.
Marilyn de Queiroz
Sheriff

Joined: Jul 22, 2000
Posts: 9043
    
  10
ooty boy,

I don't understand your question. These two classes don't look the same at all. Can you be more specific about your question?

By the way, your display name is unacceptable on JavaRanch. Please change it.


JavaBeginnersFaq
"Yesterday is history, tomorrow is a mystery, and today is a gift; that's why they call it the present." Eleanor Roosevelt
KunkalaGuntala Samba Siva Rao
Greenhorn

Joined: Nov 06, 2003
Posts: 20
currently my classes look as if its shown in option1.
if i split this like option2, will it make any difference in terms of memory allocation
Joe Ess
Bartender

Joined: Oct 29, 2001
Posts: 8705
    
    6

Originally posted by KunkalaGuntala Samba Siva Rao:
will it make any difference in terms of memory allocation

I don't think rearranging the classes would effect memory allocation much. It appears that you are just moving around the responsability for creating the screens. Looking into my crystal ball it appears you are trying to write a kind of search wizard with 4 screens and some navigation buttons. Clicking on a navigation button takes you to a new screen. You appear to create a new instance of each screen every time you navigate. This is a Bad Idea since object creation takes processor time, memory, and more processor time to reclaim once the object goes away. Look into java.awt.CardLayout. It lets you put a number of screens into a component and display them by name. It will take up more memory than your solution, but it is more efficient because the computer can concentrate on processing data rather than racing to create a new screen AND process data.
KunkalaGuntala Samba Siva Rao
Greenhorn

Joined: Nov 06, 2003
Posts: 20
for some reasons i couldn't use the CORD Layout
Will it take more memory and process speed if i pass the object like shown below
class DATAClass{
private String dbName;
private String dbconn;
private Resultset rs;
public DATAClass(String databaseName, Connection conn) {
dbconn = conn;
dbName = databaseName);
}

public ResultSet GetMethod1(Connection conn, String id) throws SQLException {
CallableStatement sproc_stmt = conn.prepareCall("{call " + dbName + ".." + "PROC1" + " (?)}");
ResultSet sproc_result = DatabaseProxy.toResultSet(sproc_stmt);
return sproc_result;
}

public ResultSet GetMethod2(Connection conn, String id) throws SQLException {
}

..more methods here for each stored proc
}

class MAINClass {
public MAINClass(){
jbInit();
}
jbInit() {

DATAClass d1 = new DATAClass("dbname","conndetails");
//Invoke the first class and load components
Class1 c1 = new Class1(d1);
c1.load_components1();
}
}
import com.samples.DATAClass;
Class1 {
private DATAClass data1;
public Class1(DATAClass d1){
data1 = d1;
}
load_components1() {
EXECUTE data1.GetMethod1;
//Paint components
}
button_click() {
Class2 c2 = new Class2(data1, this);
}
}
import com.samples.DATAClass;
Class2 {
private DATAClass data2;
private Class1 c1;
public Class2(DATAClass data, Class1 class1 ){
data2 = data;
c1 = class1;
}
load_components2() {
data2.GetMethod2();
}
go_back() {
c1.load_components1();
}
}
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: what is the difference - basic
 
Similar Threads
How to get a parent node reference in JXPath??
Please HELP...Devaka Exam Test 2 Number 69. I totally don't understand it.
Protected members
Accessing component from main class.... Help!
Call Lot of Classes in a Particular Order