By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,032 Members | 811 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,032 IT Pros & Developers. It's quick & easy.

String arrays vs Object based data structures

P: n/a
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
Share this Question
Share on Google+
3 Replies


P: n/a
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

P: n/a
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

P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.