What is difference between store and site?

Did you ever wondered why Hybris created two entities, store and site? What is the relation between them? What is the difference between them?

Most of the times, organisations have physical stores, with inventories, catalogs etc. and then they decide to have an online version for everything. Though we have exceptions now a days, where we have direct online stores, like FlipKart. Though they still have to have physical inventories to fulfill orders.

So in a sense, we can say that there are essentially two entities, one could be real (Physical) and another is virtual (Online).

So we can say that store is an entity which is associated with catalogs, stocks, currencies, language etc. The locale is associated here, as it can be looked more tightly coupled with physical analog, who are concrete in nature.

Store.impex sample,

INSERT_UPDATE BaseStore;uid[unique=true];catalogs(id);currencies(isocode);

On the other hand, we have site, which corresponds to online entity. The online entities should essentially have URLs, and language associated with them.

Sample site.impex

UPDATE CMSSite;uid[unique=true];urlPatterns;defaultlanguage(isocode)

So how do they relate??

Think once. Amazon has many physical stores worldwide. Also it has many sites, based on countries, language etc. So the relation between two is very dynamic. It has to be Many to Many.

That is how it is done in hybris in base commerce items.

<relation code=”StoresForCMSSite” generate=”true” localized=”false” autocreate=”true”>
<deployment table=”Stores4Site” typecode=”1092″ />
<sourceElement qualifier=”cmsSites” type=”BaseSite” cardinality=”many” />
<targetElement qualifier=”stores” type=”BaseStore” cardinality=”many” collectiontype=”list” ordered=”true” />

How the online site will look depends on the content, and not what is the price of a product. So content catalog is associated with cms site, not store.

<relation code=”CatalogsForCMSSite” generate=”true” localized=”false” autocreate=”true”>
<deployment table=”Catalogs4Site” typecode=”1063″ />
<sourceElement qualifier=”cmsSites” type=”CMSSite” cardinality=”many” />
<targetElement qualifier=”contentCatalogs” type=”ContentCatalog” cardinality=”many” collectiontype=”list”
ordered=”true” />

Hybris could have their own reason to do so. This is what i could envisage from my experience.

What do you think?

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s