473,503 Members | 11,237 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

String arrays vs Object based data structures

Some programmers prefer to stay with native level data structures such
as string arrays instead of using Object based data structures such as
ArrayList.

From and efficiency point of view. Are string arrays the most
efficient way of dealing with static tabular data such as query
returns? or is it more efficient to use a Recordset type data
structure using say ArrayList with a Record objects? (Pardon my JDBC
ignorance)

Personally, for business logic, I find that String arrays make for
much tighter and even more readable code as long as you use efficient
byte index constants. String arrays are also extremely portable when
porting code to and from other languages.

JsD
Jul 17 '05 #1
3 4830
I agree. I believe the arrays is your best choice, too.

"Java script Dude" <de********@yahoo.ca> wrote in message
news:86**************************@posting.google.c om...
Some programmers prefer to stay with native level data structures such
as string arrays instead of using Object based data structures such as
ArrayList.

From and efficiency point of view. Are string arrays the most
efficient way of dealing with static tabular data such as query
returns? or is it more efficient to use a Recordset type data
structure using say ArrayList with a Record objects? (Pardon my JDBC
ignorance)

Personally, for business logic, I find that String arrays make for
much tighter and even more readable code as long as you use efficient
byte index constants. String arrays are also extremely portable when
porting code to and from other languages.

JsD

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.690 / Virus Database: 451 - Release Date: 5/22/2004
Jul 17 '05 #2
Liz
If your database returns only strings or if your app
only uses strings (for the purpose you plan to use them for)
and you don't change the strings (read only) then an array
of strings is easier to understand. But the implementation
of a string array is really a bunch of references (I think)
and the strings are actually on the heap. Well, ok, so is
the bunch of references.
"Java script Dude" <de********@yahoo.ca> wrote in message
news:86**************************@posting.google.c om...
Some programmers prefer to stay with native level data structures such
as string arrays instead of using Object based data structures such as
ArrayList.

From and efficiency point of view. Are string arrays the most
efficient way of dealing with static tabular data such as query
returns? or is it more efficient to use a Recordset type data
structure using say ArrayList with a Record objects? (Pardon my JDBC
ignorance)

Personally, for business logic, I find that String arrays make for
much tighter and even more readable code as long as you use efficient
byte index constants. String arrays are also extremely portable when
porting code to and from other languages.

JsD

Jul 17 '05 #3
based on what you said, i'm thinking it all comes down to the scope of
your objectives.... if your into the let's port mystuff to different
languages... ok....

however if you into making life simple for yourself, you'll take java
for granted and use it how it is meant to be used. since it's inception
it has gone thru tremdous lenghts to shelter your app from platform
dependencies... as for performance, let's get with it... unless your
have specs like processing 1,000,000 transactions per second don't worry
about using java, worry about using yee old vax/vms.....

i get so annoyed when some mixes performance issues with portability. if
you are writing "business logic" do not worry about writing "tigher"
code as much "manageable" code. allowing you to form business objects
using objects and not strings is what java is all about....

cheers

- perry

Personally, for business logic, I find that String arrays make for
much tighter and even more readable code as long as you use efficient
byte index constants. String arrays are also extremely portable when
porting code to and from other languages.

JsD



Jul 17 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
6736
by: Golf Nut | last post by:
I am finding that altering and affecting values in elements in multidimensional arrays is a huge pain in the ass. I cannot seem to find a consistent way to assign values to arrays. Foreach would...
11
9211
by: DrUg13 | last post by:
In java, this seems so easy. You need a new object Object test = new Object() gives me exactly what I want. could someone please help me understand the different ways to do the same thing in...
33
3822
by: Peter Seaman | last post by:
I understand that structures are value types and arrays and classes are reference types. But what about arrays as members of structures i.e. as in C struct x { int n; int a; }
10
4967
by: David Fort | last post by:
Hi, I'm upgrading a VB6 app to VB.net and I'm having a problem with a call to a function provided in a DLL. The function takes the address of a structure which it will fill in with values. I...
94
4640
by: smnoff | last post by:
I have searched the internet for malloc and dynamic malloc; however, I still don't know or readily see what is general way to allocate memory to char * variable that I want to assign the substring...
64
3363
by: Zytan | last post by:
I know there are no pointers in C#, but if you do: a = b; and a and b are both arrays, they now both point to the same memory (changing one changes the other). So, it makes them seem like...
6
2360
by: rainy6144 | last post by:
Does the following code have defined behavior? double *new_array(unsigned n) { double *p = malloc(n * sizeof(double)); unsigned i; for (i = 0; i < n; i++) p = 0.0; return p; }
127
4750
by: sanjay.vasudevan | last post by:
Why are the following declarations invalid in C? int f(); int f(); It would be great if anyone could also explain the design decision for such a language restricton. Regards, Sanjay
182
4516
by: Bill Cunningham | last post by:
I understand this code. int a; int b; for (b=0;b<5;b=b+1) int a; This should take every element of the array a and set it to 1,2,3,4,5. Great. Now for the big question. How would you work...
0
7194
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7316
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
5566
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4666
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3160
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3148
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1495
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
729
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
372
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.