I've just started learning about software components but I'm completely new to this subject and I was asked to make an AngularJS application and at the same time manage the data with a hibernate application in Java, so I'd like to know What's the best way to connect my AngularJS app to my hibernate app, I may say I'm kind of lost in the subject.
I would suggest to go with Spring framework. For build/dependencies, use maven. AngularJS/Html/JS as front end tech, hibernate+JPA/Java/Spring as server side tech. Use of JPA makes things pretty simple. Initially it may look a bit puzzling for new folks, but slowly it all looks such a great things to work on.
Related
I come from a decade of experience with Java EE, SE and Java with Spring. If there's something that was drilled in me by myself and other fellow developers, was how to make use of design patterns, separation of responsibility, separating definition from implementation, interface segregation, etc. Also, we were always worried about testable code (unit testing and integration tests).
When I was learning Java, there wasn't a single book, magazine or website that didn't implemented things with those rules in mind, to the point of boredom. So we always new how things should be done from an architectural point of view when starting new stuff or maintaining code. With time, projects like Spring Boot and JBoss Seams started to give out of the box a basic project layout witch you simply followed to success(or at least you should...).
Now that I delve deep in Node.js, I miss that so much. There seems to be only a handful of people on the web worried about it and trying to teach newcomers how to write good backend code with Node.js.
People teach you how to boot express and put all of your code (database, logging, mailing, error handling and so on) inside an express route.
Of course, when I started learning Java, there was nothing preventing you from using Servlets directly with some JDBC code thrown inside, or even worse, Scriptlet inside JSPs...
I would appreciate so much to know how you for instance implement a service layer, where do you put your business logic? Do you put it in classes or functions that returns other functions? How to write easily testable code by Mocha for instance... Do I really need a controller layer, or can I trust my routes to cover that responsibility?
I'm interested in JavaScript only on the Backend, using Express.js, Socket.io, RabbitMQ, Passport.js, and GraphQL(in the future). Not interested in any rendering engine or template engines, much less JavaScript on the Browser. I'm already very proficient with Sequelizer and Mongoose.
I know the feeling of switching from Java Spring Boot to the Node.js stack. It was confusing for me in the beginning aswell, but with time you find your set of frameworks you like.
I'm probably not qualified enough to answer your entire question, but I can give you some advice of what framework helped me the most after starting with Node.js.
For me, this framework is NestJS.
It's a progressive Node.js framework to build scalable server-sided applications, based on Express.js. It supports a lot of different design patterns, but I personally use a pattern consisting of controllers, services, repositories and providers. You can use multiple different databases obviously.
Nest.js stands out for me, because you don't need any 3rd-party tutorial or documentation, because their own documentation is done really well and has basically all the information you'll ever need. It is really expandable with additional dependencies (most of them are in-house developed and have great documentation aswell).
What also has to be mentioned, is that as a Java-dev you will probably miss OOP if you switch to JavaScript. In Nest.js tough you only develop with TypeScript and overall it gives you a feeling very similar to Java Spring Boot.
I just started studying and learning about Laravel Framework. My programming originated from Java Desktop application programming and I have not tried any web framework in the past.
I've little knowledge with Javascript, some PHP, HTML and CSS.
I would like to know if it's possible and advisable to create a chat application within a social network website I'm planning to create for school semester using Laravel.
If it's not possible, what web programming language for a total web newbie like me can use?
I thought it would be best for me play around and learn Javascript because the coding style is a bit similar to Java.
I would like to create something similar with facebook's chat application.
I'd appreciate any suggestion and help.
Thank you.
For such application you can use socket.io, based on node.js. The website offers a full tutorial to build a webchat.
You could do that in PHP using websockets, but it would be more complicated.
My advice is to keep Laravel for the non-interactive parts of your application and use node.js where you need real-time features.
It's more than possible.
Actually with the new 5.3 release, Laravel provides realtime app from scratch: https://laravel.com/docs/5.3/broadcasting
You need a third party service like pusher, but it's pretty easy to implement.
Go ahead and to dive in into the laravel worl, i can recommand https://laracasts.com/
Have fun! ;)
I need to make a webApp with a good framework.
Actually i have been working with angular and i think that it can be not enought to my app because it is going to have a lot of work in the part of the client so i have thought in react.js or meteor.js.
Finally, i think that i am going to use meteor.js because it can make in the server and make the client to be with less work, but i want more opinions about it to decide what framework use.
In my app i will need to create a scenary with objects where the user is going to be able to move that objects in the scenary, so it can be a lot of work for the client.
Their all good frameworks and will have their ups and downs whatever you're building. I would suggest to use the framework you're most comfortable with.
This may help to choose: http://todomvc.com/
I've been asked to design a web application which has multiple tiers. It will have a client aspect (rendering information for the user), a server aspect (web api serving data) and a database behind it all.
I'm comfortable choosing the technology stack for the web api and database. It will either be a choice of Microsoft Web Api with SQL backend OR nodeJS with MySQL.
For me the challenge (and the prompt for this post), is choosing the correct frameworks for the client side.
I've used AngularJS quite a few times and its fairly straightforward for me to go down this road again but the project in question will have a lifespan of 5 years and I'm worried that choosing Angular 1.x, having been out since 2009 and due to be replaced by Angular 2.0, which is completely different, is a bad investment.
I will most likely use bootstrap for the base css side.
So out of the plethora of frameworks out there - what would be the strongest for client side data driven web applications?
Some obvious choices being:
Ember
Backbone
React
Knockout
Meteor
Polymer
Ractive
Durandal
Angular 2.0?
To name but a few! Which is best and why? I'm not looking to avail of server side capabilities of the likes of React. Just data (read/write) from the client side.
From your list, I tried quite a few: angular (1), backbone, ractive. I had a look at a few others but didn't investigated them further.
From my experience, Ractive was the winner. I still stick to it and am happy with it.
My first experience was with backbone. It looked pretty simple and what I needed. However, when starting to do non-trivial stuff, I ended up pretty quickly in a dead end. My view and data sometimes went out-of-sync and I didn't know how I could perform some other stuff.
My second experience was Angular. With all the hype, I thought it must be great. But getting into it was hard. It's just ...complex. As soon as I wanted to build a non-trivial directive, I was like "wtf? wtf!". The second show-stopper was the debugging ability. At some point, everything broke and my debug console just threw a strange stack trace, giving me absolutely no clue what might be the problem. ...a long time after I discovered by chance that I had placed a # instead of a # or something like this. Also, one thing I disliked from the start is that it forces you to do everything angular-ly, which doesn't always play well with other libs.
My last experience is Ractive and I write production code with it since a year or so. I'm very happy with it. Sure, it's no silver bullet and has some quirks. But overall, it's a lib where you can quickly get started with, which can do a lot, and that doesn't get in your way. The mainainers are also supprisingly responsive.
...but if you're experienced with angular, perhaps it's better to continue that way.
That's my 2 cents.
I built a quiz taker app with Ruby on Rails, using the MVC framework. I want to do basically the same thing with pure JavaScript, and add more features with jQuery for mobile devices and special effects, since jQuery is just awesome like that.
I have looked around on sites like TodoMVC for comparisons on frameworks, but I'm foreign to how these frameworks function. Why do they use Collection rather than Controller in their MVC definition? It seems to me that these are just client-side frameworks. Would I use something like Backbone.js for client-side work and Node.js for server-side?
I'm just unsure as to how development with pure JavaScript functions. I need to create a database to store quiz and user information and be able to access that database when viewing most pages, so I feel the MVC framework is the best way to go.
Any suggestions as to where to start?
Wow, that's quite a broad post; let's take things one at a time
Why do they use Collection rather than Controller in their MVC definition?
The exact answer varies by library, but a simplistic answer is that the Controllers in most Javascript apps doesn't really need any framework; they can be raw Javascript and work just fine as they're usually not very complex.
Furthermore, parts what you might consider to be "the Controller" are often provided separately. The primary example of this is Backbone's Router object: it is similar to the implied routing (and routes.rb) in Rails, or the urls.py in Django. Just as those frameworks don't consider routing to be part of "the Controller", Backbone (and similar frameworks) provide routing as a separate piece ... even though it could fall under the C in MVC.
Similarly, much of the DOM manipulation functionality that jQuery provides would normally belong in the Controller of an MVC app, so in a sense jQuery helps you build your controllers; it's just not explicit the way Backbone.Model helps you build your models.
Would I use something like Backbone.js for client-side work and Node.js for server-side?
That's really apples and oranges; to put in server-side terms, Backbone is more like Rails, and Node is more like Ruby (or Mongrel or something). So yeah one's client-side and the other's server-side, but the differences are deeper than that.
Any suggestions as to where to start?
Pick a framework and get your hands dirty! Seriously, you can spend hours reading reviews of the different frameworks, and still be no closer to making a decision at the end than when you started (I speak from experience). But if you just pick one and try it, you'll likely find that it either "gels" with you or doesn't pretty fast.
Personally, I'd recommend starting with Backbone just because A) it's very popular these days, and B) I'm biased: I use it on a daily basis and love it. Also, it probably would fit you well because it was created by the CoffeeScript guy (and CoffeeScript was his attempt to make Javascript more Ruby-like). However, Ember.js is also very popular these days, and Hector mentioned ExpressJS, which I know nothing about but could be cool.
But the point is, pick one, do a hello world, or maybe something a little more complex like an introductory tutorial (Backbone has one around a To Do app). A few hours of coding with it will tell you far more than I (or anyone else on Stack Overflow) ever could about whether it's right for you.
If you are looking for a JavaScript MVC-like framework take a look at Express.js http://expressjs.com
Express.js is more like Sinatra than Rails, but it will give you a good foundation on the server side.
I would definitely look at Google Closure. I have started to use it with LimeJs on a personnal pet project and really got caught with it's compiler and it's modular design.
It's not really MVC, but since JavaScript should be thought more in an asynchronous fashion, I tend to think more of it as event driven than simply a request-pipeline-response way.
So, Closure Library and jQuery / jQuery UI (both on Google API) for the client side and ExpressJs for the server side. Also, take a look at this framework comparison chart, you might find it interesting.