官术网_书友最值得收藏!

High-level details of objects

We deal with objects as entities representing the result of abstraction. We have already mentioned the role of the observer, that is, the programmer who defines the object based on the problem domain. The way the programmer defines this represents the process of abstraction. Let's take an example of an e-commerce marketplace and its products. Two different teams of programmers might have different views of the same product. The team that implements the website cares about the properties of the object that are essential to website visitors: buyers. The properties that we showed earlier in the Product struct are mostly meant for website visitors, such as the selling price, the rating of the product, and so on. Programmers that implement the website touch the problem domain and verify the properties that are essential to defining a Product object.

The team that implements the online tools that help manage the products in the warehouse cares about the properties of the object that are essential in terms of product placement, quality control, and shipment. This team shouldn't actually care about the rating of the product or even its price. This team mostly cares about the weight, dimensions, and conditions of the product. The following illustration shows the properties of interest:

The first thing that programmers should do when starting the project is to analyze the problem and gather the requirements. In other words, they should get familiar with the problem domain and define the project requirements. The process of analyzing leads to defining objects and their types, such as the Product we discussed earlier. To get proper results from analyzing, we should think in objects, and, by thinking in objects, we mean considering the three main properties of objects: state, behavior, and identity.

主站蜘蛛池模板: 麻栗坡县| 秦皇岛市| 金阳县| 阿尔山市| 兴山县| 蚌埠市| 明星| 双流县| 安丘市| 富阳市| 台北县| 平顶山市| 安庆市| 罗平县| 潍坊市| 文昌市| 措勤县| 仁布县| 花莲县| 玉树县| 大连市| 扎鲁特旗| 福建省| 江川县| 塔城市| 句容市| 嘉禾县| 大荔县| 清水县| 彰化县| 吉木乃县| 浑源县| 富裕县| 沾化县| 南涧| 嘉义市| 乐至县| 兴文县| 洛阳市| 南城县| 扬州市|