Two Laptop Bag*
The moose likes Java in General and the fly likes building a web app from a desktop app Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "building a web app from a desktop app" Watch "building a web app from a desktop app" New topic
Author

building a web app from a desktop app

Steve Howerton
Ranch Hand

Joined: Oct 18, 2011
Posts: 41
Hello
I have created a multi tabbed JDesktopPane The application is built using the MV2 framework and it interacts with a Derby embedded Database through properties files, XML properties and a DAO.


I would like to develop the Desktop Application into a combined or separate Web Application. How would I start this process? Will I be importing the app and building the web pages? I use an apache derby embedded database. Will I need to use another database? Can the JSP pages

Use my existing controllers and use the db to fill in JSP forms or can I use my existing app somehow? thanks

Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18716
    
    8

You can use the same database in your web application, but you'll find the Swing part of your application to be mostly useless. You'll need to rewrite the GUI as a web application from scratch. You won't be able to reuse the panels in your GUI, but you'll probably want to mimic them in HTML and Javascript.

You may find that the "business logic" in your application can be copied directly over into your web application, but if it's entangled with GUI handling, which is easy to do when you're writing a Swing application, you might find it difficult to disentangle it. (I couldn't find anything online about that "MV2" framework so I have no comment about that.)
Steve Howerton
Ranch Hand

Joined: Oct 18, 2011
Posts: 41
I taught myself MVC by trial and error. My app has over 2million lines of code. I guess the final test will be to see how well I separated the model from the view. Thanks for the feedback. So what is up with the JRebel? I looked at the web site but I will have to study it further. Are there programs that will make my app. Deploy without writing the code?
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18716
    
    8

Steve Howerton wrote:Are there programs that will make my app. Deploy without writing the code?


No, you have to write the code and then deploy the resulting application.
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18716
    
    8

Steve Howerton wrote:I taught myself MVC by trial and error. My app has over 2million lines of code.


This sounds a lot like the Swing application I've been working on for a number of years. (It was originally written in Turbo Pascal back in the 90's and then rewritten in Java.) "Trial and error" are the keywords for it too. And I've been thinking about converting it to a web application as well, which I might do when I get time.

But 2 million lines of code? You've been busy. The company I work for does about $8 billion of sales of consumer goods annually out of about 30 warehouses in 2 countries and the code base to run almost the entire business is not much over 2 million lines, written over a 30-year period.
Steve Howerton
Ranch Hand

Joined: Oct 18, 2011
Posts: 41
Interesting. I have not offically counted the lines but it has over 800 classes and a very large majority of the classes are an easy 3000 lines. I think my estimate is low. Is there a way to count them?
I have another program written in action script that deals with graphical approach to teaching Music theory on the guitar. I have written a install program in java but have not been able to get any one to look at it or market it. Is there a way to sell or market this that I could use?
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18716
    
    8

If you're using Eclipse, there are various "code quality" plugins you can install, which give you metrics like "lines of code".
Steve Howerton
Ranch Hand

Joined: Oct 18, 2011
Posts: 41
I am not sure how counting lines of code is reaningfull. I am sorry I mentioned it. I guess my point was it would take forever to rewrite the thing. I would like to understand why I need a web app? I might be better off understanding local networking. Why can't a myapp.exe run on any computer
and do so by looking on my computer for the db instead of on one of the hardrives on the client? What about networks that are not local? should it not be able to find the database on my server or hard drive rather than someone elses server?
Thanks for your replies
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: building a web app from a desktop app