下面是Demo所需要的代码:
CREATE TABLE Fee
(
Income decimal(10,1),
overhead decimal(10,1)
)
INSERT INTO Fee VALUES(1000,10)
INSERT INTO Fee VALUES(1000,20)
INSERT INTO Fee VALUES(1000,30)
INSERT INTO Fee VALUES(1000,30)
INSERT INTO Fee VALUES(1000,50)
INSERT INTO Fee VALUES(1000,60)
现在有一个报表系统,需要根据Fee表获得以下数据
收入 管理费:(overhead/100) 余额:(收入减去管理费) 评估:余额的20% 管理:余额的10% 保留:余额的5%
简单分析发现,除了收入(Income字段)和超出(overhead字段),报表中其余给出的字段都是计算字段,需要根据Income字段和overhead字段字段得出,下面是解决代码:
SELECT
Income,
overhead,
Income-(Income*(overhead/100)) ExtraFee,
(Income-(Income*(overhead/100)))*0.2 Assess,
(Income-(Income*(overhead/100)))*0.1 Manager,
(Income-(Income*(overhead/100)))*0.05 Retain
FROM Fee
aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAdEAAABwCAIAAADOlt0zAAARlklEQVR4nO2dv27juBaH+SKL3SdwNQg4eYMtttik3RRXNtxuMZitttlUd2QHyAB5hpRjOUWeYQoDwXViNwHu/p/NrTYzO7GdjIO5hSmJEimKIsX4UDrEQWDTtnQ+nsNjWZH4I5+dtQ8fPrjbuHGD6ZWieeewTWsVrNhahd8qWL4Rd5t+//69u40bN5heKZp3Dtu0VsGKrVX4rYLlG9Zc6M07h21aq2DF1ir8VsHy7Wlr7vXx7u7xtbtdarSaI21PVLYF+TCSTOufm+6a28i2I/P5syI6530YDrpthbFOA3x9vNuQkXCY2LCbw5p7e3ub7wJQcyVe2TT3NddkGDW9AhCOXCuKznmf9Pt9YM7W3wpivZuGaVOVGjEQ5YldlJ+KvIWX0mJzWHP//vvvfBeAEZF4ZdPc11yTYfS25hZE5/p4t3/++bzxRbco1scJ+Xl/t9+HFjWzppHY533pkS68vK3UyHL14MLW68e/bv736dM60z87ovToanZE6dGgy34+dMebV8/ijrhndkRZRy9in+11KSGE0OHZgD2YZ9/5fDAz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EVZhqM0D3bxzGGERH2EVhto80M07hxEW8RFWYf8HuIw72SEJahEAAAAASUVORK5CYII=" alt="" />ok,完成需求,但是我们发现Income-(Income*(overhead/100)余额重复使用了好几次,这是很不好的,因为这个代码变得非常的冗长。所以针对代码的复用性问题(DRY原则),我对代码进行了重构!
重构一、下面是重构之后的代码:
SELECT
ExtraFees.*,
ExtraFee*0.2 Assess,
ExtraFee*0.1 Manager,
ExtraFee*0.05 Retain
FROM
(SELECT
Income,
overhead,
Income-(Income*(overhead/100)) ExtraFee
FROM Fee) ExtraFees
重构之后的代码,通过子查询,将收入、超出、余额字段放入到子查询当中(将这三个字段组成一个新的临时表),然后通过检索临时表的数据来达到去除重复计算余额的目地,同样的当一条SELECT语句中,相同的计算操作多的话,都可以将相同的计算放入子查询中(形成一个新表),然后对新表进行操作!
重构之后的代码相比如之前代码的有点如下:
(1)虽然代码长度两者差不多,代码重构之后的代码更容易理解
(2)代码维护性较强,当余额的计算方法发生改变,重构之后的代码跟容易修改
重构二、
第二种方法是将相同的计算和字段放入视图中,这也是一种解决办法,代码如下:
CREATE VIEW ExtraFees AS
SELECT
Income,
overhead,
Income-(Income*(overhead/100)) ExtraFee
FROM Fee
SELECT
ExtraFees.*,
ExtraFee*0.2 Assess,
ExtraFee*0.1 Manager,
ExtraFee*0.05 Retain
FROM ExtraFees
aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAdkAAAB0CAIAAABG0N/RAAASdElEQVR4nO2dzW7jthbH+SJF+wReDQJO3qCLLppsm8WVDW+7GExX3TSrO7YDZIA8QzYXdyznAnmGWRgIrvOxCXD73aar8aQTO8k4mLvQFy1SFCVS1iF5Dg5mbFmW/j8e8khWJB7yCQ0NDQ2tbSPRf//693/Q0dHR0dvyLBc3mvJvb28b3X49g6lKYtYJ1jGvYHnzCt8rWKHd3t5iLrbJrBOsY17B8uYVvlewQttcLn7//n2j269nMFVJzDrBOuYVLG9e4XsFK7T3799jLrbJrBOsY17B8uYVvlewQms1F18f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