Solved

What is the best structure for a data object?

Posted on 1997-07-05
4
265 Views
Last Modified: 2010-04-12
Brick layers know a lot about reasonable structures for bricks and the people at GM understand that wheels should be round, but information technologists seem helpless to tell how data objects are best structured. What is the best structure or structures and why? Who are the best experts on this question?
0
Comment
Question by:eslowry
4 Comments
 

Expert Comment

by:MarkC
ID: 1010515
How long is a piece of string?Seriously, you need to know a few things about not only the data but (i) the platform and the application.
0
 
LVL 1

Expert Comment

by:byoung
ID: 1010516
I don't recall ever being "helpless" telling how data structures are best structured because, well, MarkC hit it on the nose, unless you have special powers of programming, or a whole bunch of knowledge about your needs and uses of the data object, you won't be able to tell what to use.
      In fact, using your analogies, the reason we know how to make bricks is because we know what they are needed for, the strength they must have, shape that most optimally fits the need, and a little cosmetic beauty they should posses.  Hence we came up with the modern brick.
      The wheel was probably discovered by trial and error and need.  The people had a need to roll something instead of carrying it(less energy), thus they figured out the circular shape.  The 'people at GM' now know that certain types of rubber, mixed with other elements makes a strong, resistable to heat, surface that grips the road well.  Having treads helps with water, or other surfaces.  Making the wheels hollow and pushing pounds of pressure into them helps smooth the ride....and so on.
      So you see, you must know ALOT before you can decide on anything being 'Best", because quite simply, nothing is 'Best' always.
0
 
LVL 1

Accepted Solution

by:
8051 earned 200 total points
ID: 1010517
There are two classes of structures:
uninterrupted and interrupted.

Uninterrupted are standard types (char, int, long),
arrays ( unsigned char x[10]) and structures (struct
{...}). All this types takes uninterrupted pool of
memory. This variant always can be processed faster,
with compact code and more secure.

The 'struct' definition is only LOGIC construction, help
you to handle elements offsets and types in array. Instead  
of this you can use indexes and type conversions and good compiler will generate the *same* code.

The best variable type is processor-depended. On 8-bit
processors it is a byte, on 16-bit - int, 32, 64...

Interrupted structures are lists, chains, trees and all
others takes separated memory pool for each element.
It is more complicated structures, you have to spend
more resources to handle it. If it is frequently accessible
data, try to implement it as an array or structure.

This is in general. It is true for all CPU and MPU I know.
For more detailed answer, please send more detailed question.


0
 

Author Comment

by:eslowry
ID: 1010518
This response and the other comments are helpful mainly in confirming for me the poor state of understanding that exists on the issue of what data object structures are reasonable. Thanks.
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
WinSetup from USB not cooperating 27 133
Mouse and Trackpad issue 6 51
PerfMon Report Resultts 1 36
Post Clonezilla image restore issue 6 36
this article is a guided solution for most of the common server issues in server hardware tasks we are facing in our routine job works. the topics in the following article covered are, 1) dell hardware raidlevel (Perc) 2) adding HDD 3) how t…
Moving your enterprise fax infrastructure from in-house fax machines and servers to the cloud makes sense — from both an efficiency and productivity standpoint. But does migrating to a cloud fax solution mean you will no longer be able to send or re…

829 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question