创建数据库驱动的 Java 网站的最佳方法?

发布于 2024-08-28 08:30:39 字数 715 浏览 3 评论 0原文

我对编程和java都很陌生,但我想通过一个小型数据库驱动的网站项目深入了解。我已经阅读了很多关于“现实世界”中要求 Spring 和 Hibernate 经验的需求,因此我将它们安装在 netbeans 上并创建了一个项目(如果我点击运行,我将获得默认的 spring 页面)。现在我只需要一些关于从哪里开始设计我的应用程序的指导(请告诉我对于初学者来说我是否有点难以理解!)。

我应该从我的课程开始吗? - 创建我的所有类,因为它们映射到我的数据库表并决定每个类需要哪些属性和方法?

任何人都可以推荐一些好书吗?从头开始(即从设计到部署)制作一个基于java的网站,这可能对初学者有用?

任何帮助表示感谢。

编辑:自从发布这篇文章以来,我发现了一本非常适合我入门需求的书。首先,我尝试了 spring in action 和 hibernate in action - 但发现这两种方法对于我的新手来说都有点太重了。相反,我得到了《Java EE 5 Development with Netbeans 6》一书https: //www.packtpub.com/java-ee5-development-with-netbeans-6/book 它提供了很大的帮助。如果您使用 netbeans 并且与我的处境相似,我会建议您选择它!

I'm fairly new to programming and new to java, but I'd like to jump in the deep end with a little database driven website project. I've read quite a lot about requirements in the 'real world' requesting experience with Spring and Hibernate, so I have those installed on netbeans and a project created (if I hit run I get the default spring page). Now I just need a little guidance as to where to start designing my app (please tell me if I'm getting in a bit too over my head for a beginner!).

Should I start off with my classes? - create all my classes as they map to my database tables and decide which attributes and methods each will require?

Can anyone suggest any good books for maybe.. making a java based website from scratch (i.e. from design right through to deployment) that might be useful for a beginner?

Any help appreciated thanks.

Edit: since posting this I've found a brilliant book that fits my needs just right to get started. Firstly I tried both spring in action and hibernate in action - but found both to be a bit too heavy for my novice mind. Instead I got the Java EE 5 Development with Netbeans 6 book https://www.packtpub.com/java-ee5-development-with-netbeans-6/book and its been a great help. If you use netbeans and are in a similar position to me, I'd say pick it up!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

画尸师 2024-09-04 08:30:39

太超出你的头脑了吗?取决于您希望实现什么目标。您是否正在尝试创建一个创收网站,并要求用户信任信用卡号码和其他敏感信息?那么是的,你已经超越了自己。这是供个人使用的工具还是您主要作为学习体验而组装的玩具?然后我说“噗噗!”过度头脑的概念。大胆试试吧。

至于从哪里开始,我说从你最清楚的这头野兽的任何部分开始。对数据库的外观有明确的了解吗?然后从它及其支持类开始。对代码的内部结构应该做什么有清晰的认识?从那里开始。等等。如果一切都一样,我会说从数据库层的底部开始,然后逐步向上 - 但这只是我的想法。

至于书籍,无法帮助你,但我相信有人可以。

Too over your head? Depends on what you hope to accomplish. Are you trying to create a revenue-generating site to which users will be asked to trust credit card numbers and other sensitive information? Then yeah, you're getting way ahead of yourself. Is this a tool for personal use or a toy you're throwing together primarily as a learning experience? Then I say "Pffffft!" to the notion of over-the-head-ness. Go for it.

As to where to start, I say start with whatever portion of this beast is clearest to you. Have a solid idea of what the database is going to look like? Then start with it and its supporting classes. Have a clear vision of what the guts of the code are supposed to do? Start there. Etc. And if all things are equal, I'd say start at the bottom with the database layer and work your way up -- but that's just me.

And as for the books, can't help you there, but I'm sure somebody can.

飘落散花 2024-09-04 08:30:39

我建议看一下 Web 应用程序框架,例如 Spring 的 Roo 或 Grails。遗憾的是我没有和Roo打交道的经验。但我确实有一些使用 Grails 的经验。

使用 Grails,您将主要使用 Groovy,这是一种类似于 Python 的语言,但仍然使用 JVM。您仍然可以选择在任何您喜欢的地方使用 Java(我认为)。 Grails(也许还有 Roo?)为您管理 Spring 和 Hibernate。

至于关于 Grails 的书籍,我推荐《Grails in Action》。我读过一些《Grails 1.1 Web 应用程序开发》,它似乎也是一个很好的参考。顺便说一句,netbeans 也支持 Grails。

I suggest to take a look at web application frameworks such as Spring's Roo or Grails. Sadly I have no experience with Roo. But I do have some experience with Grails.

With Grails you will be working mostly with Groovy, a language similar to Python, but still using the JVM. You'll still have the option to use Java anywhere you like (I think). Grails (and maybe Roo too?) manages Spring and Hibernate for you.

As for books on Grails, I recommend "Grails in Action". I have read a little of "Grails 1.1 Web Application Development" and it also seems to be a good reference. BTW, netbeans supports Grails too.

凉月流沐 2024-09-04 08:30:39

并不是想实现你的目标,但如果你想知道是否要开始上课,我建议你更多地锻炼你的编程技能。

我建议看一下 Larman 的 “应用 UML 和模式:对象简介-面向分析与设计和迭代开发(第3版)以及一本关于关系数据库理论的书(您需要知道如何正确地建模数据库。)

您可以尝试构建数据库驱动的Web应用程序,它可能会让您深入了解如何做到这一点,但您需要有一定的编程成熟度才能将这些技能运用到不平凡的事情中。

这完全是个人观点,因此请持保留态度:在有人着手构建数据驱动的应用程序之前为了最终能够在重要的项目中使用它,这个人需要很好地接触编程(我所说的“好”是指很多,比如 1-2 门入门课程、1-2 门中级课程和至少一门初级课程,也许总共 15-30 个学分。)除非人是天生的编程大师,否则我不认为会发生这种情况。

我建议,如果您认真对待编程,在解决此类问题之前先花大量时间学习基础知识。

祝你好运。

Not trying to gut your goals, but if you are wondering whether to start with your classes, I would suggest you work on your programming skills more.

I'd suggest taking a look at Larman's "Applying UML & Patterns: An Introduction to Object-Oriented Analysis and Design and Iterative Development (3rd Edition)" as well as a book on relational database theory (you need to know how to model databases properly.)

You can try your hand at building a database driven web app, and it might give you an insight into how to do it, but you need have some programming maturity to take those skills into the non-trivial.

This is a completely personal opinion so please take it with a grain of salt: Before someone tackles the building of a data-driven application with the purpose of eventually being able to use it in non-trivial projects, that person needs to have a good exposure to programming (by good I mean a LOT, say 1-2 introductory courses, 1-2 intermediate and at least one junior-level course, perhaps a total of 15-30 credits.) Unless that person is a natural programming virtuoso, I don't see it happening otherwise.

I would suggest, if you are serious about programming, to spend a substantial amount on learning the fundamentals before tackling something like this.

Good luck.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文