Every Customer has a physical address and an optional mailing address. What is your preferred way to model this?
Option 1. Customer has foreign key to Address
Customer (id, phys_address_id, mail_address_id)
Address (id, street, city, etc.)
Option 2. Customer has one-to-many relationship to Address, which contains a field...
I'm attempting to create a contacts application that has two main entities - person and company. A person can have many emails, numbers, and addresses. A company can also have many emails, numbers, and addresses. I'm trying to determine the proper design for this scenario.
Option #1 - multiple foreign keys
Emails, numbers, and addresses...
I'm trying to decide on the best way to model a relationship of records in a relational database. It's the classic friend/follow model:
~~~~
A User can have zero to many friends.
A User can have zero to many followers.
Friends and followers are both Users themselves.
~~~~~
What's the best way to model this?
Thanks!
...
The situation:
Lets say we are implementing a blog engine based on JCR with support for localization.
The content structure looks something like this /blogname/content/[node name]
The problem:
What is the best way to name the content nodes (/blogname/content/[nodename]) to satisfy the following requirements:
The node name must be us...
I'm currently in the process of converting some small personal web sites from WebForms to MVC. With the existing sites, the database schema is solid but I had never really taken the time to build proper data/business models/layers. The aspx pages all talked to the database directly using a variety of Views and Stored Procedures that we...
Hi,
I am fairly new to this discussion but I HAVE to ask this question even at the risk of sounding 'ignorant'. Why is it that we now stress so much on 'DDD'. The more I look into 'DDD' the more complex it seems to make my application. Whereas modeling my domain with the database helps keep my application consistent across layers. Then ...
hi,
please clarify me on the below questions,
who will do the great data model design?
Technical lead / Database Admin
Thanks,
Gunasekaran Sambandhan
...
Is it possible to include one function inside another? To learn functions, I'm trying to create a combat sequence using PHP. The sequence would look like this:
Dice would roll, assigning numbers to variables;
Hero1 attack results are printed;
Dice would roll, assigning numbers to variables;
Hereo2 attack results are printed;
Dice woul...
Hi,
I am just starting on ASP.NET MVC trying to understand the philosophy first. I think I am pretty clear on the roles played by the controller and the view but I am a little confused on the model part. Some sources say its the domain model, some say its the data model, some say its the objects that are bound to the view.
IMHO these a...
The "party model" is a "pattern" for relational database design. At least part of it involves finding commonality between many entities, such as Customer, Employee, Partner, etc., and factoring that into some more "abstract" database tables.
I'd like to find out your thoughts on the following:
What are the core principles and motiva...
What's the longest possible worldwide phone number I should consider in SQL varchar(length) for phone.
considerations:
+ for country code
() for area code
x + 6 numbers for Extension extension (so make it 8 {space})
spaces between groups (i.e. in American phones +x xxx xxx xxxx = 3 spaces)
here is where I need your help, I want it to ...
Is there any open source data modeler available? If yes, which is the best or closest to Rational Rose?
...
I have a model which has a required string property like the following:
class Jean(db.Model):
sex = db.StringProperty(required=True, choices=set(["male", "female"]))
When I try calling Jean.all(), python complains about not having a required property.
Surely there must be a way to get all of them.
If Steve is correct (his answer...
I am looking to do some modeling and would like to have a tool that can capture not only a relational model like ERWIN but also allow us to easily port to LDAP as an option.
NOTE: Visio can connect to an existing LDAP server and draw, but does not allow for you to model first and then deploy, unlike its relational capabilities.
...
Are there tools that make the job easier? If command-line only tools exist, then can anyone speculate if there is a market for a GUI tool? For example, you can create a relational database by modeling visually. Should the same notion exist for LDAP?
...
I have a domain object used in an identity map (the keys are the object's Id property).
Pseudocode:
map = new Mapping();
map[domainObj.Id] = 'foo';
I observe the object to tell me when it has been saved to the database:
domainObj.bind('saved', function() {
map[domainObj.Id] = 'new foo!'
})
For new objects the Id field is empty...
I often come across web applications that expose internal database primary keys through forms like select boxes. And occasionally I see javascript matching against an int or guid magic value that switches the logic.
Is is a best practice to avoid leaking all internal identifiers of rows in your web application to prevent outsiders from...
I'm trying to do things the DDD (domain driven design) way. And boy do I struggle. In all books I read, Authentication is of no concern and not mentioned!
I've written my own Authentication and Membership Service which are responsible for registering and logging in users, creating salted passwords etc. I do not use .NET's Membership Pro...
Hello,
I'm new to Rails and don't grasp yet all the possibilities with associations. Here's my problem:
I have a couple of models like apple and lemon.
Then there's the model 'relation' that holds triples of relations:
subject | relation | object
apple | is sweeter than | lemon
The migration for 'relations' is this:
create_table :...
My requirement is for a data model where a full audit trail is retained for changes to every attribute of every object. Object definitions are also fluid: new attributes can appear or go away over time. This audit trail will live separately from the original databases, so a trigger-based auditing model won't work.
In a relational data...