Solved

What is the best structure for a data object?

Posted on 1997-07-05
4
267 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone 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

Monitor input from a computer is usually nothing special.  In this instance it prevented anyone from using the computer.  This was a preconfiguration that didn't work.
This article outlines why you need to choose a backup solution that protects your entire environment – including your VMware ESXi and Microsoft Hyper-V virtualization hosts – not just your virtual machines.
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

740 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