简体   繁体   中英

Information duplication vs separation of concerns

I'm working on a HTML table generated by jQuery. My first instinct is to pair the table with a regular two-dimensional array where I can do easily the manipulations I want.

At first, it seemed like a great idea, but I'm realizing that it involves some nasty information duplication. On the other hand, it could improve the separation between the logic and the view.

Does separation of concerns contradict the "don't repeat yourself" principle? If so, what principle should be preferred? If not, what model of design can overcome the apparent paradox?

Are you able to read/manipulate the data directly from the table? If not, then transforming the data into array form should not be an issue; you are merely applying data transformation . However, if you CAN read/manipulate the data directly from the table, then do so.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM