Win a copy of Machine Learning Systems: Designs that scale this week in the Scala forum
or Xamarin in Action: Creating native cross-platform mobile apps in the Android forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

View layer logic - where should it go?  RSS feed

 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've got a tree-like data structure which I'm displaying on a web page. As the user navigates through a breadcrumb trail is left behind to let them retrace their steps.

e.g. Root / First Group / Second Group / Third Group (where the groups are links back up)

At the moment the function to create the links is in the jsp. It's only used in one place so this seemed the pragmatic option though I'm not sure if it's "correct". I realise it wouldn't make any sense to put it in the entity itself but would a static class that generates the links, callable from the jsp make more sense?

Just curious about people's opinions and experiences on this one.
 
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Originally posted by Ross Hendry:
... It's only used in one place so ...



What do you mean by this?
There is only one JSP that shows this?
 
Ross Hendry
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Originally posted by Ben Souther:
What do you mean by this?
There is only one JSP that shows this?



Yes. The breadcrumb trail is only used in one place.

At least, it was at time of posting. The customer's wanting it in a couple of other places now so I'll be writing that bean for reusability.
 
I found a beautiful pie. And a tiny ad:
Rocket Oven Kickstarter - from the trailboss
https://coderanch.com/t/695773/Rocket-Oven-Kickstarter-trailboss
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!