• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
  • Bear Bibeault
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Piet Souris
  • salvin francis
  • Stephan van Hulst
Bartenders:
  • Frits Walraven
  • Carey Brown
  • Jj Roberts

One menu to control flow between others

 
Greenhorn
Posts: 22
IntelliJ IDE MySQL Database Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,
Im making ControllerMenu to manage the transition between menus.


All my Menus have got only non-static methods and they are using instances from Service layers to connect/edit everything from data layers.
Individual menus should not require a ControllerMenu (so it cannont appear in any Menu constructor, as a class field and I think I shouldnt make an instance of it in these classes) . The dependency should only be one way. This is my solution for this problem:
https://pastebin.com/pepjBQN8
But in my opinion this code is pretty messy-a lot of instances for every method etc. Is there any another way to make it works? Most beautiful solution it would be "using methods (and make them non-static) from ControllerMenu without creating instances in every Menu" but I think its impossible.

reply
    Bookmark Topic Watch Topic
  • New Topic