Having UI dependencies in controller!

18 views
Skip to first unread message

Sara

unread,
Nov 1, 2012, 2:09:10 AM11/1/12
to jmesa...@googlegroups.com
Hello,

I am a big fan of JMesa and am enjoying its different cool features. But one of my teammate who doesn't know much about it is complaining about something as bellow:

So basically using JMesa I have moved some of my UI code to controller, besides that I have an import to the worksheet and also for the worksheet to work I have implemented the saveWorkSheet() method as bellow:

public void saveWorksheet(Worksheet worksheet) {
    saveWorksheetChanges(worksheet);
    }
    });

What my teammate is saying is that controller should not be bounded to any UI component. There shouldn't be any import in controller to a UI component like worksheet and besides that we should not have to implement such a method as above in controller. He is saying if the UI technology changed my controller shouldn't break.

So what are you inputs on this.

Thanks.

Neil Benn

unread,
Nov 1, 2012, 4:53:13 AM11/1/12
to jmesa...@googlegroups.com

Hello,

  Change teams ;).

Cheers,

Neil

Sara

unread,
Nov 1, 2012, 10:48:34 AM11/1/12
to jmesa...@googlegroups.com
:) Thank you good advice,

I was thinking if there is away around calling that interface method from controller.


Sara.

Neil Benn

unread,
Nov 1, 2012, 10:58:49 AM11/1/12
to jmesa...@googlegroups.com
Hello,

  To be honest; I tried to avoid JMesa specific things in my spring controllers but the added power you get from it made em just think - pah!  It is a balance between 'purity' and practicality in my view; simply judge when you break the rules - it is part of being a skilled programmer!

Cheers,

Neil

Jeff Johnston

unread,
Nov 1, 2012, 11:23:56 AM11/1/12
to jmesa...@googlegroups.com
I also use whatever makes sense for the problem I have. When you need more control its hard to beat using the API directly and (in my opinion) its worth bending the rules a bit. But the tags are usually more than enough.

As far as saving the worksheet in the controller, I am surprised that that is an issue. The WorksheetSaver is really nothing more than a convenience wrapper to get the data out of the users session.

Remember too that you can use the TableModelUtils, which is easier when using the tags.

-Jeff

Sara

unread,
Nov 1, 2012, 4:30:00 PM11/1/12
to jmesa...@googlegroups.com
Thanks Jeff,

I too understand that. I agree with you, but I think he wants to stick with the technologies they have been using for years. Anyways, I used JMesa and was done with UI so quickly that they cannot even cope with me.

Thanks again.

Sara

unread,
Nov 1, 2012, 4:31:31 PM11/1/12
to jmesa...@googlegroups.com
Neil,

I totally agree with you. Sometimes what we think is best practice is not really the best. 

Thanks.
Reply all
Reply to author
Forward
0 new messages