1

Topic: The best experts: server applications

Kind time of days! After fair time without Java (JS/PHP/Rails/etc.) I try to return to Java and to study creation of server applications on Spring + Hibernate (the blessing is the real task). Esteemed the documentation on all these technologies, all is technically clear, but the best experts in respect of the organization of development process and  are not clear. In particular: 0) the Stack of technologies for simple microservice (HTTP/XML/REST): Spring, Hibernate... What I is mandatory should use still not to fence bicycles? 1) that we use for the assembly? In my stay Java programmer there was a universal hell and a burning loss on Ant. Now like as standard Maven is  and the standard? 2) migrations in a DB. Like as it is not necessary Hibernate + FlyAway. Here I described a persistens-class of model with summaries - as to me now to generate migration in a SQL-file? FlyAway is able to apply only them (, such I and itself can). How it is better for coordinating to a script for the assembly? Or there is any other variant with DB update By the machine of the developer On  3) the Web server - Tomcat for  still ? How it is better to automate  on ? There after all besides war-file filling also item 2 (structure migrations + the data)

2

Re: The best experts: server applications

Hello, sharez, you wrote: S> Kind time of days! S> after fair time without Java (JS/PHP/Rails/etc.) I try to return to Java and to study creation of server applications on Spring + Hibernate (the blessing is the real task). S> Esteemed the documentation on all these technologies, all is technically clear, but the best experts in respect of the organization of development process and  are not clear. In particular: S> 0) the Stack of technologies for simple microservice (HTTP/XML/REST): Spring, Hibernate... What I is mandatory should use still not to fence bicycles?  it is sufficient for specified,  it is not necessary for , it ORM and not that it needs to be pushed the fact in any project. S> 1) that we use for the assembly? In my stay Java programmer there was a universal hell and a burning loss on Ant. Now like as standard Maven is  and the standard? maven - yes if it would be desirable alternatives - gradle and less popular ivy, sbt. S> 2) Migrations in a DB. Like as it is not necessary Hibernate + FlyAway. Here I described a persistens-class of model with summaries - as to me now to generate migration in a SQL-file? FlyAway is able to apply only them (, such I and itself can). How it is better for coordinating to a script for the assembly? S> or there is any other variant with update of DB S> By the machine of developer S>) On  In my opinion usage emergent circuits - not the best variant.  it is better to describe it manually and "classes with summaries" to use not to write only "the manual" code of a binding of model to result set. S> 3) the Web server - Tomcat for  still ? How it is better to automate  on ? There after all besides war-file filling also item 2 (structure migrations + the data) the Web server - yes, it is possible to try still jetty. It seems docker + CI it is sufficient for the declared. From alternatives of creation restful microservice on  it is possible to look on dropwizard which offers large enough and convenient basic "units".

3

Re: The best experts: server applications

7/17/2017 17:39, sharez writes:> 0) the Stack of technologies for simple microservice (HTTP/XML/REST): Spring,> Hibernate... What I is mandatory should use still not to fence> bicycles? We normally use standard JEE-shnye JAX-RS+CDI+JPA, it quite suffices also it is from a box in any jee7-compatible server. In some projects on an insisting of customers we use Spring or SpringBoot is too quite working decisions. If at microservice one and it idle time - look on SpringBoot.> 1) That we use for the assembly? In my stay Java programmer there was> a universal hell and a burning loss on Ant. Now like as standard Maven is>  and the standard?  it is necessary and sufficient.> 2) migrations in a DB. Like as it is not necessary Hibernate + FlyAway. Here I described> a persistens-class of model with summaries - as to me now to generate> migration in a SQL-file? FlyAway is able to apply only them (, such I> itself can). How it is better for coordinating to a script for the assembly? > Or there is any other variant with DB update> By the machine of the developer>) On  We use liquibase, at it in particular is and servlet listener for DB update at application start. Under summaries the circuit not ,  we write hands. - WBR, Serge. Posted via RSDN NNTP Server 2.1 beta

4

Re: The best experts: server applications

Hello, hrensgory, you wrote:>> On  H> We use liquibase, at it in particular is and servlet listener for H> DB updates at application start. Under summaries the circuit not , H>  we write hands. I correctly understand that you: 1) Manually change DB structure by the machine of the developer 2) Manually change classes 3) Before  on  write SQL queries on change of structure from (1)? It turns out that you double one action three times. It is possible to write at once, of course, , but in my opinion, it is the extremely inconvenient, when the creative thought flies (and is not present accurate  which we implement). I will simply describe, how all becomes in Rails: 1) we give a command a-lja "to Create migration: in table X to add column Y with type Z" 2) we Apply migration by the current machine, and then on . Manually here it is not necessary to describe any classes of type JPA, all will be applied in all places. In my opinion this one of those decisions in Rails which should be added in the same Java. I am a little surprised that this mechanism and was not  (at least with inverse: generation migration under the class description - it is serious, in the same place in a class all is already described in summaries).

5

Re: The best experts: server applications

Hello, A13x, you wrote: A> it ORM and not that it needs to be pushed the fact in any project. It seems to me doubtful that is possible in convenient form to do something like://users, orders, products - tables in DB Order lastOrder = Users.get (id).getOrders ().getLast (); Set <Product> products = lastOrder.getProducts (); echoAsXml (products); In case of manual access on JDBC the code will be not so beautiful, and, the main thing, . Or manual access in the form of SQL queries (or prepared statement - not an essence) still is considered the adequate code? I why ask, because it is a lot of where (avenues Rails) look at such code bewildered during time at the code-revju and demand to rewrite on ORM.

6

Re: The best experts: server applications

7/19/2017 12:16, sharez writes:>>>) On > H> We use liquibase, at it in particular are and servlet listener for> H> DB updates at application start. Under summaries the circuit not ,> H>  we write hands.>> 1) manually change DB structure by the machine of the developer> 2) Manually change classes> 3) Before  on  write SQL queries on structure change> from (1)? No. The class changes, is then written  (well or on the contrary). Generally it is applied both by the machine of the developer, and in further (on a test circuit, industrial, etc.). For those  which need to be applied only on defined environment (we admit, in  it is not necessary to do loading of the test data) -  it allows in parameters  to specify. - WBR, Serge. Posted via RSDN NNTP Server 2.1 beta

7

Re: The best experts: server applications

Hello, sharez, you wrote: S> I will simply describe, how all becomes in Rails: In the beginning was black anything, and only  flickered in it. curl generated  and gave it I speak in a deep voice, and generated  cut, and generated cut , and generated  , and generated  , and generated   and the chief, both , and , and .  generated turnip and , and  from turnip generated from  , and the chief in  entered, and it generated  and , and the chief.  generated ,  entered in  and   surrounding, and remained it is happy baked. Also generated   from happy  with   in , and saw  merdzh-kommit in , and it generated an artifact, and he sent it on  on . So, my son,  from  gets in  at sect makovodov-rubistov.

8

Re: The best experts: server applications

Hello, hrensgory, you wrote: H> Is not present. The class changes, is then written  (well or on the contrary). But after all it is absolutely doubling actions. What sense to do by hands (with possibility to be mistaken) what it is possible to make correctly only one method on completely given input parameters? At me as at the programmer the first thought - to automate, really in Java it is not made yet? Perhaps on it there is a reason? I speak not about changeset', changing the data. I about primitive removal and adding of columns and tables in a DB.

9

Re: The best experts: server applications

7/20/2017 14:22, sharez writes:> From: *sharez* </Users/104129.aspx>> Hello, hrensgory, you wrote:>> H> Is not present. The class changes, is then written  (well or on the contrary).>> But after all it is absolutely doubling actions. What sense to do by hands (possibility to be mistaken) what it is possible to make correctly only one> a method on completely given input parameters? Such approach is selected deliberately in connection with specificity of directions of development. Applications in which development we participate or which we develop by own strength as a rule live long, and the DB circuit endures many releases of application. Sometimes even round the same DB there are absolutely other applications. Therefore designing of a DB at us is conducted carefully enough, its structure is exposed to the most severe types the code  and we do not want to trust JPA to the provider to project a DB for us. In the project on the average at us from several tens to several hundreds tables to write their generation by hands not too  (in comparison with development of business logic and ).> At me as at the programmer the first thought - to automate, really> Java it is not made yet? Perhaps on it there is a reason? It is automated, it is possible to order to the same Hibernate  the DB circuit under your summaries (including in a mode update), it really works. Then, truth, in working DB sometimes there are ridiculous titles of tables or columns, because of the admitted misprints) - WBR, Serge. Posted via RSDN NNTP Server 2.1 beta

10

Re: The best experts: server applications

Hello, sharez, you wrote: S> After fair time without Java (JS/PHP/Rails/etc.), I try to return to Java and to study creation of server applications on Spring + Hibernate (the blessing is the real task). If that, look on https://grails.org/It uses Spring and should beat it is similar on Rails.

11

Re: The best experts: server applications

Hello, sharez, you wrote: S> Kind time of days! S> after fair time without Java (JS/PHP/Rails/etc.), I try to return to Java and to study creation of server applications on Spring + Hibernate (the blessing is the real task). S> Esteemed the documentation on all these technologies, all is technically clear, but the best experts in respect of the organization of development process and  are not clear. In particular: Hold, can it is useful:  Like it is not bad written.

12

Re: The best experts: server applications

Thanks all for answers! The perfect code became a little closer

13

Re: The best experts: server applications

Hello, sharez, you wrote: S> I speak not about changeset', changing the data. I about primitive removal and adding of columns and tables in a DB. I so understand, you ask about it: Automatic schema generation Yes,  can create and automatically  the DB circuit. We write migratory scripts if there are any not trivial changes in the circuit.

14

Re: The best experts: server applications

Hello, sharez, you wrote: S> Hello, A13x, you wrote: A>> it ORM and not that it needs to be pushed the fact in any project. S> it seems to me doubtful that is possible in convenient form to do something like: S> S>//users, orders, products - tables in DB S> Order lastOrder = Users.get (id).getOrders ().getLast (); S> Set <Product> products = lastOrder.getProducts (); S> echoAsXml (products); S> S> In case of manual access on JDBC the code will be not so beautiful, and, the main thing, . S> Or manual access in the form of SQL queries (or prepared statement - not the essence) still is considered the adequate code? I why ask, because it is a lot of where (avenues Rails) look at such code bewildered during time at the code-revju and demand to rewrite on ORM. And now it seems to me doubtful that the code described above as simply to expand. Also the thesis about ugliness and, the main thing,  the code fulfilling  (on the basis of the same spring-jdbc) is absolutely unobvious. I will not be  about it, I proved for a long time it to myself, if there is a desire to reflect on this subject advise to pay attention to the following: 1. Despite apparent ease  people accompanying the big project face with "leaky abstractions" . At this forum of some persons with what problems they already showed faced at high loading or at performance something more difficult, than object obtaining on ID. 2. In "normal" application the code of saving of the data will be separated from model logic business since often happens that business model can be composite and the part of the data can come generally from other service. In a case with JDBC  simply to deal with any kinds of objects, well for example - partially to fill  for  lombok models. Well and at last more system presentation here

15

Re: The best experts: server applications

Example of an operating stack of technologies: the Assembly and the project organization - Maven (  the standard on which remaining tools) an application Frame (DI, integrations from a DB, queues equal and so forth, REST/HATEOAS MVC) - Spring Boot HTTP the server built in - Tomcat, configuration HTTPS is trivial and mandatory. Microservice architecture - Spring (Netflix) Cloud (the configuration server, the register and detection of services, client equalization of loading, API Gateway, OAuth2...)  and development in a cloud - Docker (there is a good plug-in for Maven from Spotify) +Ansible this decision is the pluses and minuses, it will be not mandatory the best for your project, but it is precisely efficient. If fierce scalability is not necessary, throw out from list Spring Cloud and Ansible (Docker all the same it makes sense - to lift quickly the most simple method the necessary surrounding from zero that very much helps with development process). DB migrations - Flyway, unambiguously, it is supported in Spring Boot. You can generate the first migration by means of ORM, but in prom. a surrounding to assign migration ORM it is not necessary (all the same happens tuning, filling with the data of reference manuals, etc.) is necessary. For AWS I recommend to look on Boxfuse.

16

Re: The best experts: server applications

Hello, sharez, you wrote: S> In case of manual access on JDBC the code will be not so beautiful, and, the main thing, . S> Or manual access in the form of SQL queries (or prepared statement - not the essence) still is considered the adequate code? I why ask, because it is a lot of where (avenues Rails) look at such code bewildered during time at the code-revju and demand to rewrite on ORM. I would not tell that Rails the sample of ideal architecture, but it so, an introduction. On business: now ORM thanks to such products as Hibernate it is treated very widely and solves, besides actually , tasks of caching, transactional handling and what the hell still. Besides, language Java is badly fitted to implementation good ORM because of absence property literals (with envy I look on Linq). Accordingly, it is very easy to shoot  to itself at a foot and to write difficultly supported or, the brake code is worse than that. It does not mean that it is necessary to write always SQL hands. But in Java to the world a rule normally reverse: at first quickly you write with usage ORM, then you optimize on plain JDBC (as a variant, it is possible to throw out EM and to leave for yourself only summaries JPA to simplify generation SQL by hands).

17

Re: The best experts: server applications

Hello, sharez, you wrote: S> I will simply describe, how all becomes in Rails: S> 1) we give a command a-lja "to Create migration: in table X to add column Y with type Z" S> 2) we Apply migration by the current machine, and then on . Manually here it is not necessary to describe any classes of type JPA, all will be applied in all places. ORM is object-relational mapping, instead of relational-relational mapping, you compare a hedgehog and . ActiveRecord in Rails is not ORM, and it is perfect other architecture. If to you it is necessary ActiveRecord, look on ActiveJDBC in javalite.

18

Re: The best experts: server applications

Hello, Baudolino, you wrote: B> DB Migrations - Flyway, unambiguously, it is supported in Spring Boot. You can generate the first migration by means of ORM, but in prom. a surrounding to assign migration ORM it is not necessary (all the same happens tuning, filling with the data of reference manuals, etc.) is necessary. By the way, I here that thought. In mine  a web service will be about 4 simple tables, and no more 50-100 lines totally. A site with certainly small loading (internal API). The approach with  saving  objects on a disk does not practise? From complexities while only I see necessity to write a browser of a DB and long seek time search. But as speed of development if there is no DB would grow. There was an access to a DB through API, there was simply an access on a variable.

19

Re: The best experts: server applications

Hello, sharez, you wrote: S> the approach with  saving  objects on a disk does not practise? No, for what for? If it would be desirable absolutely easy built in DB with the minimal requirements on reliability, take any built in H2, adjust to it a cache so that all basis got into a heap and periodically launch  according to a manual. But  to lift in container Postgres easier.

20

Re: The best experts: server applications

Hello, Baudolino, you wrote: B> Hello, sharez, you wrote: S>> the approach with  saving  objects on a disk does not practise? B> is not present, for what for? If it would be desirable absolutely easy built in DB with the minimal requirements on reliability, take any built in H2, adjust to it a cache so that all basis got into a heap and periodically launch  according to a manual. But  to lift in container Postgres easier. Yes speech any more about a functional or speed of operation, and about speed of a spelling of the code (without doubling DB-structures). At least for creation of prototypes.