[英]Can you write a web application with just the Java programming language?
My end-of-term assignment is to build a web-based student management application which connects to a MySQL database.我的期末任务是构建一个基于 Web 的学生管理应用程序,该应用程序连接到 MySQL 数据库。 However, the teacher does not allow us to use JS/ node because he says it is not OOP.
但是老师不允许我们使用JS/节点,因为他说不是OOP。 Besides from JS, the members in our group can only use Java.
除了来自JS,我们群里的成员只能使用Java。
Therefore, I want to ask if it's it possible to do this assignment with just Java.因此,我想问是否可以仅使用 Java 完成此任务。 If it is, what are the things I need to know and learn?
如果是,我需要了解和学习哪些内容? Else, is it possible to learn PHP in 1 month for this kind of project?
否则,这种项目是否可以在 1 个月内学习 PHP?
Thank you very much for reading!非常感谢您的阅读!
Sure you can write a web app in Java.当然,您可以在 Java 中编写 web 应用程序。 Depending on what you're allowed to use there are tons of options.
根据您被允许使用的内容,有很多选项。 Just a short overview, further down means you need more 3rd party code but productivity goes up:
只是一个简短的概述,进一步向下意味着您需要更多的 3rd 方代码,但生产力会提高:
Yes it is possible to write a webserver in Java without any external (ie not Java SE) libraries.是的,可以在没有任何外部(即不是 Java SE)库的情况下在 Java 中编写网络服务器。 All you need to do is:
您需要做的就是:
Socket
and ServerSocket
and the SSL stack, and...Socket
和ServerSocket
以及 SSL 堆栈,以及... Which is... a lot of effort, and probably a waste of you / your team's time.这是......很多努力,可能会浪费您/您的团队的时间。
If you are going to implement this in Java, you would be much better off either learning Spring / SpringMVC / SpringBoot, or learning Servlets and/or JSPs.如果你打算在 Java 中实现这个,你最好学习 Spring / SpringMVC / SpringBoot,或者学习 Servlets 和/或 JSP。 They deal with the protocol side for you, and (more or less) leave you to focus on the aspects that are specific to your webapp.
它们为您处理协议方面,并且(或多或少)让您专注于特定于您的 web 应用程序的方面。
These technologies (or equivalents) are what you are likely to use when you graduate.这些技术(或同等技术)是您毕业时可能使用的技术。
If the other members of your team already know Java, that would be an obvious good reason to use it.如果您团队的其他成员已经知道 Java,那显然是使用它的好理由。
In short, there are 3 reasons to use Java + the above technologies:总之,使用Java+以上技术有3个理由:
PHP would be another alternative, though if your teachers are "down" on Javascript for being "not OO enough", they are probably unlikely to think well of PHP either. PHP 将是另一种选择,但如果你的老师因为“不够 OO”而对 Javascript “失望”,他们可能也不太可能对 PHP 有好感。
On the topic of whether Javascript is OO or not, read this:关于 Javascript 是否为 OO 的话题,请阅读以下内容:
Read it and make up your own mind.阅读并下定决心。
1 - How about volunteering to write all of the project's documentation so that you don't have to learn Java. 1 - 自愿编写所有项目的文档怎么样,这样您就不必学习 Java。 No?
不? You want to learn Java, don't you!
你想学Java,对不对!
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.