Pages

Tuesday, September 29, 2009

Social network vs Community site

Yesterday, when I have to research a technical solution for a new prospect, I asked some questions to Mr. Hong - an excellent Technical manager in our company - about approaches to build current system for a big community. He tells me many good points and consult me a lot. However, I found another lack thing in my knowledge: what are differences between Online Community site and Social network? For a long time, I use the terms "online community" and "social network" interchangeably.

After trying searching and digging into these concepts, I found some points help me to understand them more clearly.
A social network is a social structure made of individuals (or organizations) called "nodes," which are tied (connected) by one or more specific types of interdependency, such as friendship, kinship, financial exchange, dislike, sexual relationships, or relationships of beliefs, knowledge or prestige.
Social network analysis views social relationships in terms of network theory about nodes and ties. Nodes are the individual actors within the networks, and ties are the relationships between the actors. The resulting graph-based structures are often very complex. There can be many kinds of ties between the nodes. Research in a number of academic fields has shown that social networks operate on many levels, from families up to the level of nations, and play a critical role in determining the way problems are solved, organizations are run, and the degree to which individuals succeed in achieving their goals.

(From http://en.wikipedia.org/wiki/Social_network)

A virtual community, e-community or online community is a group of people that primarily interact via communication media such as newsletters, telephone, email, internet social network service or instant messages rather than face to face, for social, professional, educational or other purposes.

(http://en.wikipedia.org/wiki/Online_community)

These definitions may make us more confuse. However, in my opinion, these are some things that we should consider:
1. Target of a social network is "building the social structure". Target of an online community site is: "building communication tools of a community". Anyways, in many cases the boundary is not always clear.
2. All activities of a user in a social network must be attached with "social nodes". That means "a user joined to a social network must find and expand his/her relationships". Without doing this, he/she can not see any activities are happening. This is the strongest point of social network ("encouraging and forcing making relationships"). In online community site, this is not required. You can join a community site (like Community Server forum) and can see all happening activities without making friends with anyone. (I found this point in this article).

I am waiting for your comments and sharings about these concepts!

Wednesday, September 23, 2009

Meditation Garden iPhone app and SiO2


I love this app. It inspires me to develop app with SiO2 game engine!

MeditationGarden from SIO2 Interactive on Vimeo.

Saturday, September 12, 2009

NHibernate auto create database bug when using attribute for mapping

I am on vacation. However, I've just received a feedback email from a developer in Brazil on TinyERP (an open source project that I posted several months ago). He found that TinyERP framework can not create database automatically although he set the "create" value for hibernate.hbm2ddl.auto NHibernate properties in spring.xml config.
Actually, I haven't released any version of TinyERP in Codeplex. In the past, I created a sample database (not generate DB automatically from schema). Anyway, I need to check this issue.
After several minutes checking, I found the issue:

In TinyERP, I use NHibernate attribute on Business Entity for mapping. To use this, we have to override a LocalSessionFactoryObject to add assembly contains Business Entity classes into HbmSerializer. HbmSerializer only helps us to create Hibernate mapping config in stream. A very stupid thing is: the code to check and generate DB schema does not exist in parent classes of LocalSessionFactoryObject => Nothing happens when you set hibernate.hbm2ddl.auto="create".

The old code
public class LocalSessionFactoryObjectImp : LocalSessionFactoryObject
    {
        protected override void PostProcessConfiguration(NHibernate.Cfg.Configuration config)
        {
            base.PostProcessConfiguration(config);
            HbmSerializer.Default.Validate = true;
            IList modules = ApplicationConfiguration.GetInstance().Modules;
            foreach (Module module in modules)
            {
                Assembly assemblyInAppDomain = FindAssembly(module.Assembly);
                if (assemblyInAppDomain != null)
                {
                    config.AddInputStream(HbmSerializer.Default.Serialize(assemblyInAppDomain));
                }
            }
           
        }

The above code is a common code template to override LocalSessionFactoryObject - that we mostly see in many forums. The problem is: default SessionFactoryObject in NHibernate keeps the code to export DB schema. However, LocalSessionFactoryObject and its parent class do not implement any line of code for this. So, we have to add this feature manually if we want to override it.

This is the new code to fix this issue:
public class LocalSessionFactoryObjectImp : LocalSessionFactoryObject
    {
        protected override void PostProcessConfiguration(NHibernate.Cfg.Configuration config)
        {
            base.PostProcessConfiguration(config);
            HbmSerializer.Default.Validate = true;
            IList modules = ApplicationConfiguration.GetInstance().Modules;
            foreach (Module module in modules)
            {
                Assembly assemblyInAppDomain = FindAssembly(module.Assembly);
                if (assemblyInAppDomain != null)
                {
                    config.AddInputStream(HbmSerializer.Default.Serialize(assemblyInAppDomain));
                }
            }
            SchemaExport schemaExport = new SchemaExport(config);
            string autoCreateDBMode = config.GetProperty("hibernate.hbm2ddl.auto");
            if (!string.IsNullOrEmpty(autoCreateDBMode) && autoCreateDBMode == "create")
            {
                schemaExport.Create(true, true);
            }
        }
}

Hope it's useful in case you have same problem with using NHiberate attribute for mapping and auto creating DB schema.

Friday, September 11, 2009

I am inventor of Facebook

Now, I become a famous man - Inventor of Facebook. Don't you believe?
See below video: