Cemre Mengü
Cemre Mengü

Reputation: 18754

Location and responsibilities of Main class in MVC pattern

I am trying to build a simple currency converter using SWING and MVC. My question is: in an MVC pattern where should be the Main class generally located? Should it be in a separate package initializing the model, view, controller and setting up the connections etc.? or should the Main class be in the View package? In other words, whose responsibility is to build the whole system?

Upvotes: 11

Views: 4505

Answers (1)

Jigar Joshi
Jigar Joshi

Reputation: 240918

where should be the Main class generally located ?

Main class should just act as initilizer of the app, you can place it in a package called

com.yourcompany.currencyconverter.app.main

Should it be in a separate package initializing the model, view, controller and setting up the connections etc. ?

Yes, it would be nice to have it separated from the rest.

Upvotes: 12

Related Questions