M
M
max_mara2013-08-09 02:57:22
Java
max_mara, 2013-08-09 02:57:22

How to write in Java/Scala/C#/etc?

Habrahabr, help!

I recently uploaded (half a year ago) a couple of manuals on the Spring Framework, I was tormented for a long time with Hello World, after a couple of days I finally managed to see the long-awaited cherished words on the monitor. During this time, I came across maven, tomcat, deployment, compilations, project builds.

On PHP or Node.js I wrote like this

  • Wrote the code
  • Reloaded the page
  • rejoiced
  • PROFIT...?


So, here. This technique is not suitable in this case, because Hello World compiles and deploys for about thirty seconds. What if it's not hello world? For some reason, it seems to me that people working in banks do not update the page a thousand times until something changes there

. Now I actively use the rock and the Play Framework, I love them very much. But the feeling that I am not writing correctly does not leave. What to do? How to write? How to continue to live?

Thanks

Answer the question

In order to leave comments, you need to log in

6 answer(s)
S
Snowindy, 2013-08-09
@max_mara

In Java, especially using the Spring Framework, normal development is something like this
: 1) we divide the system into layers: a data storage layer with an interface, a business logic layer with an interface, a web application or web service layer (for example).
2) Each of the layers is covered with Unit tests (automated testing), while the rest of the system, for which there are dependencies, looks just like interfaces that can be “emulated” for the duration of the tests (test mocking technique).
3) Integration testing (automated/semi-automated testing) - several layers are run in an almost real environment, and tested together like a black box. We look at how the system works as an assembly.
4) Manual testing of the entire system before release - you are just used to this.
Most of the work happens in steps 1 and 2. Test-Code-Change-Test Cycle - usually happens within a few seconds, since Unit tests are lightweight.
The development cycle you describe has one serious limitation - no automatic protection against functionality regressions. That's what tests are for.

D
deadkrolik, 2013-08-09
@deadkrolik

That's why they invented tests.

S
SergeyGrigorev, 2013-08-09
@SergeyGrigorev

You can also use JRebel to update code as you go, including EJBs. This will save time on deployment (I usually run deployment no more than 3 times a day). And I agree with deadkrolik that it's good to write unit tests, so you can quickly find and fix an error in a separate section of code.

J
javax, 2013-08-09
@javax

You run it from the IDE, it compiles only the classes that have changed, after that the server rises - well, you have to wait 10 15 seconds and that's it.

S
stemm, 2013-08-09
@stemm

In your case, a bunch of Spring + embedded Jetty + Maven + IDE Eclipse is suitable.
Embedded Jetty speeds up development a lot. you can make changes to the code and restart the application very quickly - it takes me 2-3 seconds. If you need to edit JSP, JS or CSS, the application can not be stopped at all.
The application structure is described in more detail here: steveliles.github.io/setting_up_embedded_jetty_8_and_spring_mvc_with_maven_and_no_xml.html

V
Vladimir Golovanov, 2013-08-12
@Colwin

It's all about the purpose and scope of the application.
If you need a small Application, you can at least use JSP + Servlet.
If a large application with many modules, integration with various systems and a flexible system of dynamically connected modules, these are completely different approaches a la Spring + Hibernate + Maven + JBoss, separation into layers, separation of the data model from the domain model, etc. .
Your question is too general for specific recommendations. A good architect chooses the means according to the task.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question