473,385 Members | 1,983 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

How many database objects to put in an entity framework model?

I have about 12 services that will be used on the website I am working on. A
few of them are News, Events, Venues (that work directly with Events),
Mailing lists and some others. Each one of these services will have some
classes and enums that are contained in a namespace of their own. When it
comes to the data access (entity framework), I need to know how to design
the model. Do I just put all of the database objects in a single model, or
do I split it up based on the service and put that entity model in the
rightful namespace? Can somebody give ideas?

Nov 11 '08 #1
3 2438
Splitting is fine as long as you can keep the objects unique. This can be
done by either naming them different or by placing them in another namespace
(you can do this with folders in the project to simplify). If you cannot do
one of the above (or both), it is often easier to make one big model. if you
have no dupes from serveice to service, there is no big deal.

A single big model looks daunting, but the objects only fill when requested,
so you are not trailing that much weight behind you if you go this route. It
is not optimal, for sure, but we are not all designing for Google like
performance, so it will probably be fine.

--
Gregory A. Beamer
MVP: MCP: +I, SE, SD, DBA

Blog:
http://feeds.feedburner.com/GregoryBeamer

********************************************
| Think Outside the Box! |
********************************************
"Andy B" <a_*****@sbcglobal.netwrote in message
news:eM**************@TK2MSFTNGP03.phx.gbl...
>I have about 12 services that will be used on the website I am working on.
A few of them are News, Events, Venues (that work directly with Events),
Mailing lists and some others. Each one of these services will have some
classes and enums that are contained in a namespace of their own. When it
comes to the data access (entity framework), I need to know how to design
the model. Do I just put all of the database objects in a single model, or
do I split it up based on the service and put that entity model in the
rightful namespace? Can somebody give ideas?
Nov 13 '08 #2
So, the question would be then, is it better to make multiple entity models
in different namespaces that target only a particular "service" or job than
to have 1 huge model hanging around? or is it better to have 1 huge model
that all code draws its data from?
"Gregory A. Beamer" <No************@comcast.netNoSpamMwrote in message
news:C2**********************************@microsof t.com...
Splitting is fine as long as you can keep the objects unique. This can be
done by either naming them different or by placing them in another
namespace (you can do this with folders in the project to simplify). If
you cannot do one of the above (or both), it is often easier to make one
big model. if you have no dupes from serveice to service, there is no big
deal.

A single big model looks daunting, but the objects only fill when
requested, so you are not trailing that much weight behind you if you go
this route. It is not optimal, for sure, but we are not all designing for
Google like performance, so it will probably be fine.

--
Gregory A. Beamer
MVP: MCP: +I, SE, SD, DBA

Blog:
http://feeds.feedburner.com/GregoryBeamer

********************************************
| Think Outside the Box! |
********************************************
"Andy B" <a_*****@sbcglobal.netwrote in message
news:eM**************@TK2MSFTNGP03.phx.gbl...
>>I have about 12 services that will be used on the website I am working on.
A few of them are News, Events, Venues (that work directly with Events),
Mailing lists and some others. Each one of these services will have some
classes and enums that are contained in a namespace of their own. When it
comes to the data access (entity framework), I need to know how to design
the model. Do I just put all of the database objects in a single model, or
do I split it up based on the service and put that entity model in the
rightful namespace? Can somebody give ideas?

Nov 13 '08 #3
You pretty much hit it on the nail and your application(s) will let you know
which is the better approach. If there is lots of shared data (same tables)
between services, a single model might be preferable, as you do not end up
with dupes. If you do dupe, you will have to separate out the models
(namespaces is the easiest option) or uniquely name entities. if many of
your entities are one to one maps, different names for objects is probably
not a good option, as it is confusing .... imagine this conversation;

When you use the X service, the weather object is name weather, but in the Y
service is is name wtr and in the Z service it is named wether.

Anything that you have to document like this shows a project not well
thought out. ;-)

--
Gregory A. Beamer
MVP: MCP: +I, SE, SD, DBA

Blog:
http://feeds.feedburner.com/GregoryBeamer

********************************************
| Think Outside the Box! |
********************************************
"Andy B" <a_*****@sbcglobal.netwrote in message
news:es*************@TK2MSFTNGP06.phx.gbl...
So, the question would be then, is it better to make multiple entity
models in different namespaces that target only a particular "service" or
job than to have 1 huge model hanging around? or is it better to have 1
huge model that all code draws its data from?
"Gregory A. Beamer" <No************@comcast.netNoSpamMwrote in message
news:C2**********************************@microsof t.com...
>Splitting is fine as long as you can keep the objects unique. This can be
done by either naming them different or by placing them in another
namespace (you can do this with folders in the project to simplify). If
you cannot do one of the above (or both), it is often easier to make one
big model. if you have no dupes from serveice to service, there is no big
deal.

A single big model looks daunting, but the objects only fill when
requested, so you are not trailing that much weight behind you if you go
this route. It is not optimal, for sure, but we are not all designing for
Google like performance, so it will probably be fine.

--
Gregory A. Beamer
MVP: MCP: +I, SE, SD, DBA

Blog:
http://feeds.feedburner.com/GregoryBeamer

********************************************
| Think Outside the Box! |
********************************************
"Andy B" <a_*****@sbcglobal.netwrote in message
news:eM**************@TK2MSFTNGP03.phx.gbl...
>>>I have about 12 services that will be used on the website I am working
on. A few of them are News, Events, Venues (that work directly with
Events), Mailing lists and some others. Each one of these services will
have some classes and enums that are contained in a namespace of their
own. When it comes to the data access (entity framework), I need to know
how to design the model. Do I just put all of the database objects in a
single model, or do I split it up based on the service and put that
entity model in the rightful namespace? Can somebody give ideas?

Nov 15 '08 #4

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

Similar topics

34
by: yensao | last post by:
Hi, I have a hard time to understand difference and similarities between Relational database model and the Object-Oriented model. Can somebody help me with this? Thank you in advance. ...
5
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...
19
by: Steve Jorgensen | last post by:
I've run across this issue several times of late, and I've never come up with a satisfactory answer to the best way to handle this schema issue. You have a large section of schema in which a...
115
by: junky_fellow | last post by:
What is a C object ? If i have some function "func()" in my C program, then can i say that "func()" is a C object ? or if i have some function pointer (ptr) which contains the address of...
4
by: Flip | last post by:
Sorry for the obvious newbie type question. :< And I know doing stuff in Java is not 100% transferable to c#/.net, so I apologize for my ignorance. But I am asking, therefore trying to learn. ...
3
by: Retep | last post by:
Hi all, hopefully someone can answer the following mystery for me: I have the following (simplified) application setup: Main Form | Form |
5
by: Marijn | last post by:
Hello everybody, I am new to PHP and working on extending my knowledge of OOP. The posts in this group concerned with whether or not to use an OO approach when programming in PHP is not what I...
3
by: chris.kennedy | last post by:
I am really struggling to create an entity which maps to 2 "base" entities. I have a customer and invoice entity which are based in tables in a one to many relationship. I have tried: 1....
0
by: zman77 | last post by:
Hi. My solution (working in VS 2008) has a C# console app, and a C# web service. The service has an entity data model. It has numerous stored procedures. For one of the stored procs, which just...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?

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.