First to make sure good should the reservation of public resources and the management system of resources classification,
Two broad categories:
Class A resources: an infinite sharing resources, when the user use it, must want to care about whether someone USES or is there any chance for their own use, such as when there are more than limit will not be able to use (swimming pool, parking lot, etc.), and only A single use of resources (lawn mower, A fire extinguisher, etc.),
Class B resources: can be infinite and Shared resources, such as street, square, basketball court (or use restrictions did not limit), which is no problem as long as the resource itself, you can use,
For these two kinds of resources, of course, there are some common features, such as whether is available, the corresponding area, corresponding star class, etc.,
A resource can be divided into: many people sharing resources and single resource, many people can share resources such as parking lot, swimming pool, A single resource such as lawn mower, fire extinguisher, etc.,
Class B resources no longer segmentation,
Also there are some common properties: class A resources such as whether can share?
A kind of resource:
Many people sharing resources: public baths, swimming pool, gym, parking lot,
Single resource: lawn mower, a fire extinguisher, public telephone,
Class B resources:
Street lights, fire hydrant, square, basketball courts,
All resources of common attributes: ID, name, corresponding to the area, if available,
The characteristics of A kind of resource: whether can share, corresponding star class, whether to collect fees,
The characteristics of single resource:
The characteristics of people sharing resources: can accommodate the number of open time, the current number, booking number,
The characteristics of class B resources:
According to the above situation, has the following solutions:
Table 1. Only one products, covering all the properties of the each attribute with a field said,
2. A single sheet of the product table, all of the attributes in a field together, and then add a field private property, and then an item all private property in the field,
3. The private property sheet product table + + private property value table
The product table: product_id="1"; Product_name="1" swimming pool,
Private property sheet: attitude_id="1"; Attitude_name="whether can share";
Private property value table: id="1"; Product_id="1"; Attitude_id="1"; Attitude_value="HTTP://https://bbs.csdn.net/topics/to share";