?
Solved

What is the best structure for a data object?

Posted on 1997-07-05
4
Medium Priority
?
271 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

Get your Disaster Recovery as a Service basics

Disaster Recovery as a Service is one go-to solution that revolutionizes DR planning. Implementing DRaaS could be an efficient process, easily accessible to non-DR experts. Learn about monitoring, testing, executing failovers and failbacks to ensure a "healthy" DR environment.

Question has a verified solution.

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

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…
Arrow Electronics was searching for a KVM  (Keyboard/Video/Mouse) switch that could display on one single monitor the current status of all units being tested on the rack.
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
Suggested Courses
Course of the Month13 days, 13 hours left to enroll

800 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