• 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 ...
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
  • Bear Bibeault
  • Jeanne Boyarsky
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Piet Souris
  • salvin francis
  • Stephan van Hulst
  • Frits Walraven
  • Carey Brown
  • Jj Roberts

One menu to control flow between others

Posts: 22
IntelliJ IDE MySQL Database Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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:
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.

Can you shoot lasers out of your eyes? Don't look at this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
    Bookmark Topic Watch Topic
  • New Topic