Skip to main content

Manage Custom Fields in the Database

There a lot of debates about how to store custom fields in database. Here is some interesting links that help me to get decision (in my case is EVA solution :-))

Storing Custom Fields in the Database (see also comments) - http://blog.springframework.com/arjen/archives/2008/01/24/storing-custom-fields-in-the-database/

Thread from forum - http://osdir.com/ml/bug-tracking.bugzilla.devel/2005-01/msg00191.html

Guide to the EAV (FAD) - http://weblogs.sqlteam.com/davidm/articles/12117.aspx

http://en.wikipedia.org/wiki/Entity-Attribute-Value_model

The circumstances where you would need to go beyond standard row-modeling to EAV are listed below:

  • The data types of individual attributes varies (as seen with clinical findings).
  • The categories of data are numerous, growing or fluctuating, but the number of instances (records/rows) within each category is very small. Here, with conventional modeling, the database’s Entity-Relationship Diagram might have hundreds of tables, with the tables containing thousands/ millions of rows/instances emphasized visually to the same extent as those with very few rows; the latter are candidates for EAV.
    This situation arises in ontology-modeling environments, where categories ("classes") must often be created on the fly, and some classes are often eliminated in subsequent cycles of prototyping.
  • Certain ("hybrid*) classes have some attributes that are non-sparse (present in all or most instances), while other attributes are highly variable and sparse. The latter are suitable for EAV modeling. classes are seen in business database applications. For example, descriptions of products made by a conglomerate corporation depend on the product category, e.g., the attributes necessary to describe a brand of light bulb are quite different from those required to describe a medical imaging device, but both have common attributes such as packaging unit and per-item cost.

Comments

Popular posts from this blog

Reflector for .Net - amaizing how open your .Net source code

Reflector for .Net - Reflector is the class browser, explorer, analyzer and documentation viewer for .NET. Reflector allows to easily view, navigate, search, decompile and analyze .NET assemblies in C#, Visual Basic and IL. At same site there are also other interesting tools like: Resourcer for .NET - Resourcer is an editor for .resources binaries and .resX XML file formats used with the .NET platform Mapack for .NET - Mapack is a .NET class library for basic linear algebra computations.

Must To Have Utilities

FileMon - FileMon monitors and displays file system activity on a system in real-time. Note: Filemon and Regmon have been replaced by Process Monitor on versions of Windows starting with Windows 2000 SP4, Windows XP SP2, Windows Server 2003 SP1, and Windows Vista. Unlocker - The solution for "Cannot delete file: Access is denied" error message. Dependency.exe - Dependency Walker is a free utility that scans any 32-bit or 64-bit Windows module (exe, dll, ocx, sys, etc.) and builds a hierarchical tree diagram of all dependent modules. SCDL version 1.1 - Generates source code for config sections based on an XML sample, also creates the XSD schema for the section. Expresso - Regular Expression Editor and Tester

Post on behalf of Facebook Page using Graph API

Assuming someone would like to give your permissions to post on his Facebook Pages :-), you need to do following things: Ask for the publish_stream and manage_pages using Facebook Authentication Dialog Get Page Access Token. Such access token can be retrieved by issuing an HTTP GET to /USER_ID/accounts with the manage_pages permission. This will bring you list of the pages and access tokens of such pages. You also can you /PAGE_ID?fields=access_token request to get access token for specific page. (Reference - https://developers.facebook.com/docs/reference/api/page/) Once you have page access token you will be able to post. Posting can be done using following parameters: curl -F 'access_token={ACCESS_TOKEN}' \ -F 'message={MESSAGE TO POST}' \ https://graph.facebook.com/{PAGE}/feed