orm - Fluent NHibernate: rarely used properties as Component, or in seperate table? -


I wonder if you can help me with some of the things I was thinking that we have One unit says that there is an expandedInfo object in this regard, which has many properties which are not often used.

I am thinking that FNH is the simplest thing that I understand that User Inform will be set as a Flint Anhehennet 'Component' of the User Entity so that the user table will have this form of column Flat is mapped in

However, since it is not used very often, it would be better to store it in a separate table, and load lazy when necessary? How to do this is my best guess

Any ideas on the best way to go here?

Thanks

Design issue:

Mapping it as a component is easy to handle, the database schema becomes simpler, as well as handling this class

when you map it to several-to-one , Then it requires an id when other types are using this UserInfo , then they need to be stored in the same table as well as you have to keep in mind that U The same example of serInfo is not used by many owners. It is not feasible with components, you can not share UserInfo .

Display problem:

When it is mapped as a component, it always loads simultaneously with reason Because it requires reading a bit more data from the disk and sending a little more data via the wire. Unless it UserInfo does not contain large amounts of data, or you intend to store millions of users, you will not recognize it.

When you map it to a different table, NH reads UserInfo using a different query that says it's rare, but if you have a user If you need UserInfo for a large amount, then this data can be greatly reduced by accessing the query. You need to get the query (fetch mode join ), then it is a Will be read using the internal join.

To reduce a long story:

Mapping of any other table (multiple-to-one) is a lot of work; it is worth only effort If you solve known (!) display problem in user in any case you UserInfos


Comments

Popular posts from this blog

MySql variables and php -

url rewriting - How to implement the returnurl like SO in PHP? -

Which Python client library should I use for CouchdB? -