473,756 Members | 3,211 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

different design considerations for objects and tables

hi everyone,

I am designing a pallet management system. Many items are placed onto one
pallet. The items are all unique and have distinct features. Now, as far as
application design is concerned the most intuitive way of handling this
would be to have a Pallet object that holds an array of Item objects, which
reflects the situation in real life. As far as database design is concerned,
however, it is easier for the item to 'know' which pallet it belongs to.
e.g. I would create a table for the individual items where one of the
fields is palletID.

So what do I do? It would be very confusing (I think) to have different
design approaches in the application and in the database schema.

TIA

eddiec :-)
Jul 22 '05 #1
2 1282
"eddiec" <ch***@netspace .net.au> wrote in message
news:40******** @news.iprimus.c om.au...
hi everyone,

I am designing a pallet management system. Many items are placed onto one
pallet. The items are all unique and have distinct features. Now, as far as application design is concerned the most intuitive way of handling this
would be to have a Pallet object that holds an array of Item objects, which reflects the situation in real life. As far as database design is concerned, however, it is easier for the item to 'know' which pallet it belongs to.
e.g. I would create a table for the individual items where one of the
fields is palletID.

So what do I do? It would be very confusing (I think) to have different
design approaches in the application and in the database schema.


Since this is not really a question about C++, you may have more luck if you
post this in a different newsgroup, like comp.object, which covers general
OO design.

--
David Hilsee
Jul 22 '05 #2
eddiec wrote:
hi everyone,

I am designing a pallet management system. Many items are placed onto one
pallet. The items are all unique and have distinct features. Now, as far
as application design is concerned the most intuitive way of handling this
would be to have a Pallet object that holds an array of Item objects,
which reflects the situation in real life. As far as database design is
concerned, however, it is easier for the item to 'know' which pallet it
belongs to.
e.g. I would create a table for the individual items where one of the
fields is palletID.

So what do I do? It would be very confusing (I think) to have different
design approaches in the application and in the database schema.

TIA

eddiec :-)


Hi,
if you insist on realizing the datastructure within your objects, then this
is a question about OO design, which is of interest in this news group only
as far as C++ happens to support OO design.

However, in C++ there are other approaches to go about your particular
problem. You have two types of objects: pallets and items. Moreover, each
item is placed on one and only one pallet. Thus, abstractly, you have a map
assigning pallets to items:

f : Items --> Paletts.

Viewed from this angle, you might use a container (like
std::map<Item,P alett>) that implements this setup. However, you might also
want to iterate through all items on a given pallet. Thus, the container
should allow for efficient compuatation of preimages and offer an iterator
type for this purpose.

Solving this problem as a (possibly templated) container has the advantage
that you can change the implementation afterwards without affecting the
design of the classes Pallet and Item.
Best

Kai-Uwe Bux
Jul 22 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
1205
by: Jose Perez | last post by:
Hello all, I am trying to correctly model the relationship between products and versions within my db. The problem I have is how to store the version data. I need to collect the following information: 1) Major Build Number (int) 2) Minor Build Number (int) 3) Build Number (int) 4) SP number (int)
5
674
by: Don Vaillancourt | last post by:
Hello all, Over the years as I design more database schemas the more I come up with patterns in database design. The more patterns I recognize the more I want to try to design some kind of generic design patterns that can be used and shared amongst many sub-schemas. For example, the grouping of entities. I may have the following tables: employee, product and client. These tables have no direct relationship with each other. But...
8
3071
by: news | last post by:
I seriously doubt this is possible...but you never know, so here goes. Due to bad pre-planning I have a Web page that is VERY table heavy with a very complicated and delicate setup. Any changes to the table structure, as in size changes or additions of new cells, throws the whole thing out of whack. (Let me pause here to say I understand quite well that tables in general are not a good idea anymore. Didn't know that until after I...
10
2116
by: BlueDolphin | last post by:
I'm not sure if this is a question or more of a rant... but I'm looking for some input on this from other developers out there. How often has the following happened to you and how have you dealt with it. I am consulting on a new project. Originally I was going to get data dumped to me from an external system, and import the needed data once a week into a normalized design that I had created. I knew what my fields were going to be,...
11
2570
by: Peter M. | last post by:
Hi all, I'm currently designing an n-tier application and have some doubts about my design. I have created a Data Access layer which connects to the database (SQL Server) and performs Select, update, delete and inserts. I use dataset objects to pass data to and from the DAL. In my GUI (windows forms), I use databinding to bind controls to a datatable
48
2636
by: Tony | last post by:
How much bloat does the STL produce? Is it a good design wrt code bloat? Do implementations vary much? Tony
2
3191
by: Jami Bradley | last post by:
I'm in need of some design suggestions! We have a fairly large DB with thousands of users accessing data throughout the day. I have been given the task of restructuring a core part of the web application. It will be a design example for the rest of the site and I really want to get it right the first time! Basically we need to present a lot of data to the user. On a single page, we summarize about 5000 rows (grouped so they don't...
19
3173
by: neelsmail | last post by:
Hi, I have been working on C++ for some time now, and I think I have a flair for design (which just might be only my imagination over- stretched.. :) ). So, I tried to find a design certification, possibly that involves C++, but, if not, C++ and UML. All I could find was Java + UML design certifications (one such is detailed on http://www.objectsbydesign.com/tools/certification.html). Although UML is expected to be language independent,...
0
2470
by: jsimone | last post by:
This question is about DB2 table design and performance. We are using DB2 UDB Enterprise 8.2 on Linux. We have 6 tables in a parent-child (one-to-many) relationship with each other. Each child table having an FK up to its parent. This particular design is motivated by our domain model. A -> B -> C -> D -> E -> F There is some debate in our team about how best to accomplish this. Two approaches have been discussed.
0
9275
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10034
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9872
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9843
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8713
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6534
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5142
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5304
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2666
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.