Daily WTF

In General   September 2, 2005 - 12:05 pm

本來在查 de-coupling 相關的文章,結果看到這篇的範例

PHP:
  1. If lblClientName.BackColor = RGB(255, 0, 0) Then 'new client
  2.    
  3.     'Setup the client account
  4.     Call SaveNewClientData
  5.  
  6.     'notify use of success
  7.     If lblClientNum.ForeColor = RGB(0, 0, 153) Then
  8.         MsgBox "Client was created but is pending activation."
  9.     ElseIf lblClientNum.ForeColor = RGB(0, 128, 0) Then
  10.         MsgBox "Client was created and was successfully activated."
  11.     ElseIf lblClientNum.ForeColor = RGB(255, 0, 0) _
  12.             And lblClientNum.Caption = "999999" Then
  13.         MsgBox "There was an error creating the client. " & _
  14.                "Please ensure all required fields were entered."
  15.     End If
  16.    
  17.     'ED: Snip ...
  18. End If

很天才的直接用UI的顏色來判別使用者的權限,將來如果那位設計師用css改了這些顏色,整個business logic就被催毀了,這真正是 MVC anti-pattern的最佳教材啊~

另外,the daily WTF 這個站是工程師們吐苦水的地方,偶爾沒事上去看看笑笑(搞不好還可以學到些警愓)也挺不錯的,我正考慮把上次某金控神奇db的故事貼上去...

by admin

留言回應

hidden

您的留言會先經過站長認証後才刊登在網站上。
your comments will be approved by Administrator before appearing on the page.

Trackback this post  |  Subscribe to the comments via RSS Feed

mobile phone