473,608 Members | 1,784 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 2447
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_*****@sbcglo bal.netwrote in message
news:eM******** ******@TK2MSFTN GP03.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.netNoS pamMwrote in message
news:C2******** *************** ***********@mic rosoft.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_*****@sbcglo bal.netwrote in message
news:eM******** ******@TK2MSFTN GP03.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_*****@sbcglo bal.netwrote in message
news:es******** *****@TK2MSFTNG P06.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.netNoS pamMwrote in message
news:C2******** *************** ***********@mic rosoft.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_*****@sbcglo bal.netwrote in message
news:eM******* *******@TK2MSFT NGP03.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
7061
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. Yensao
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...
19
2353
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 subset of records across all tables is often considered a separate logical system, but sometimes may be treaded ar part of the global system, and there is not simply a 1-m-m... tree among the records in a logical database. Here's an example. A...
115
4860
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 function "func()", can i say that ptr is pointing to some C object ? Is a C object always associated with some "data" ? thanx in advance for any help .....
4
1046
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. In j2ee you can create entity ejbs to model data as objects. The benefit is you can use the objects in your code as just that, objects. I haven't been able to see if .net can do this, is this true/false? Oh, before you get too far with wrtting...
3
1795
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
2710
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 want to discuss in this post. Rather I would like to discuss the best way to program the following problem: I have a MySQL Database which for example exists of phonenumbers. The table might look something like this.
3
1974
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. Creating a Invoice Entity based on the Invoice and adding a mapping to both tables: I can't validate the model it says "Two entities with different keys are mapped to the same row. Ensure these two mapping fragments do not map two groups of entities with...
0
3444
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 returns data (SELECT blah blah FROM...), I added a function import called "Iservice." I saved all, then in my console app, updated the service reference to my C# service. Now, in my console app, I am trying to do the following: This doesn't work....
0
8014
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,...
1
8168
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
8362
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6833
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
5493
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
3981
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
4043
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2486
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
1349
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.