Is it frowned upon to make Java applications as applets if they are not going to be embedded?
It seems that applets are a lot easier to develop in many cases. In my first Java classes we were told to avoid u开发者_如何学Csing applets, but now that I am in more advanced classes the instructors do not seem to care. How do most developers feel about making Java applications applets even if those applications are never going to be embedded? Is there any other major stuff (other than embedded vs. non-embedded) I should consider before making my applications either applets or stand alone?
Why do you believe that "applets are a lot easier to develop"? I don't see any advantages apart from the ability to embed them in webpages.
Most importantly, applets run in a sandbox per default, and thus are very restricted in what they can do.
And what do you mean with an applet "never going to be embedded"? How are you going to run it then? There's a standalone appletviewer, but AFAIK that only comes with the JDK - not good for end users. And if you run it in a browser without a surrounding webpage, you still have a useless and (to the user) confusing browser window around it.
An applet just has a different execution environment than a stand alone application with a main(...). Which one to use, depends on what you need it to do. There is nothing wrong with supporting both the applet and application environment.
精彩评论