2 Replies - 254 Views - Last Post: 07 April 2014 - 09:38 AM Rate Topic: -----

#1 externity  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 07-April 14

when to use multiple main methods?

Posted 07 April 2014 - 08:42 AM

I am confused when it is proper to use an application with multiple entry points, or I guess an application with multiple interconnected modules. I have a network application (Netty) as well as a web application (spring). I can bundle them together, in effect tightly coupling them together, or I can modularize them to operate interdependently of each other while still working together to make the application whole.

Is there any specific reason for making an application a single entity vs multiple entities? Is it "desired" to have a self contained application (eg. One main method)?

Is This A Good Question/Topic? 0
  • +

Replies To: when to use multiple main methods?

#2 modi123_1  Icon User is offline

  • Suitor #2
  • member icon



Reputation: 8390
  • View blog
  • Posts: 31,200
  • Joined: 12-June 08

Re: when to use multiple main methods?

Posted 07 April 2014 - 09:13 AM

It seems to be dependent on the nature of the project as well as the future needs for it. There's no sense in going the extra mile for code you know won't need extra entry points, but there is a benefit to sit and think about future needs and get multiple entry in on the ground floor.
Was This Post Helpful? 0
  • +
  • -

#3 g00se  Icon User is online

  • D.I.C Lover
  • member icon

Reputation: 2557
  • View blog
  • Posts: 10,673
  • Joined: 20-September 08

Re: when to use multiple main methods?

Posted 07 April 2014 - 09:38 AM

Quote

I am confused when it is proper to use an application with multiple entry points

or I guess an application with multiple interconnected modules.


Multiple entry points are not supported in Java apps. One main method only is allowed. As far a potential entry points is concerned, that's rather different and ties in with the other part of your question. Generally speaking, it's a good idea for code to be as modular as possible. This promotes flexibility and code reuse
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1