0

I am writing an ntier website which contains a table of information. I am using jeditable to make the table editable.

The client wants some fields in the table readonly depending on whether the information they contain is before or after a particular date. Should the readonly logic reside in the business layer or the ui layer?

Regards Si

Sico
  • 1,183
  • 1
  • 10
  • 16

2 Answers2

1

Both. Your UI should check those non-editable fields an then no provide controls to modify the fields and also, for security, your business layer should also disable that functionallity.

Erre Efe
  • 15,387
  • 10
  • 45
  • 77
  • Thanks. So are you suggesting maybe a boolean "editable" flag at the business logic end? Was worried that the fact that I may use the word "edit" implies knowledge of the UI. – Sico Sep 17 '12 at 20:37
  • 1
    @Sico Whether a particular field can be edited is relevant throughout the entire application from the data through the UI. – Servy Sep 17 '12 at 20:39
  • @Servy Point taken, bit of a homer simpson comment by myself :) – Sico Sep 17 '12 at 20:43
0

Business layer. The before or after date rule could change - it's business logic.

The business layer should execute the rule and communicate the fact to the UI layer. It should be enforcing the immutability on its end regardless of what the client does.

duffymo
  • 305,152
  • 44
  • 369
  • 561