Solved

What is the best structure for a data object?

Posted on 1997-07-05
4
259 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

Scale it in WD Gold

With up to ten times the workload capacity of desktop drives, WD Gold hard drives employ advanced technology to deliver among the best in reliability, capacity, power efficiency and performance.

Join & Write a Comment

Is it worth it to buy an Echo? In a word, yes! For me it was definitely worth it. I use mine on a daily basis. Prologue & Privacy At first, I was very skeptical about the Amazon Echo. In general, I don't like voice assistants. I don't li…
Does your iMac really need a hardware upgrade? Will upgrading RAM speed-up your computer? If yes, then how can you proceed? Upgrading RAM in your iMac is not as simple as it may seem. This article will help you in getting and installing right RA…
This video discusses moving either the default database or any database to a new volume.
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

758 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now