Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

what is the correct way for building websites using spring framework

 
Ranch Hand
Posts: 658
2
Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
I am planning on building a Forum kind of website but since I am not having experience in website development, I got confused in what stack to choose and how to use that stack. For the backend, I am definitely going to choose Spring-hibernate. For front end obviously, HTML-CSS-JS is the only choice.
As per my understanding, I was going to choose Spring MVC where spring-hibernate will directly pass the data to the View Layer. But yesterday morning, I was discussing it with my senior in office and he guided me that this is not the way the big websites are built.
The perfect way is -> Use Spring framework to build webservices and Hibernate to connect to DB. Then in the view layer, along with HTLM-CSS use Angular.js for accessing the webservices you made. Don't just use Spring and view layer directly talking with each other, instead fetch the data using that webservice you made. This will be helpful for you to integrate your website with the mobile app as well - as per him.

Could anyone please suggest is it true that big websites are developed in this way? And if not then what is the correct way?
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Likes 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator

Puspender Tanwar wrote:I was going to choose Spring MVC where spring-hibernate will directly pass the data to the View Layer. But yesterday morning, I was discussing it with my senior in office and he guided me that this is not the way the big websites are built.


Many sites, especially legacy sites that have been around for a while are still built this way. But...

The perfect way is -> Use Spring framework to build webservices and Hibernate to connect to DB. Then in the view layer, along with HTLM-CSS use Angular.js for accessing the webservices you made.



"perfect" way? Dubious...

Aside from the "perfect" claim, many (most?) modern web apps are built this way: using the backend as a RESTful API, and writing a front-end application using a modern SPA JavaScript framework such as Angular or React. (Angular is hardly the only choice.)
 
Puspender Tanwar
Ranch Hand
Posts: 658
2
Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator

Bear Bibeault wrote:"perfect" way? Dubious...


Means there are other good ways as well?
 
Bear Bibeault
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator

Puspender Tanwar wrote:

Bear Bibeault wrote:"perfect" way? Dubious...


Means there are other good ways as well?



As in, look with suspicion on anything that says it's "perfect" or the "only way".

There are tons, and I means tons, of different ways to approach web development.

That said, the concept of creating a RESTful backend that is used by multiple front-ends (web, mobile, and so on) is very prevalent and currently very "en vogue". Is it the only way? No. Is it the "perfect" way? Nothing is perfect.

That also said, at least to me, the old way of creating UI on the server to send to the front-end (JSP, JSF, SpringMVC, et al) seems very antiquated. But it's still very much in use.

What's your goal?
 
Puspender Tanwar
Ranch Hand
Posts: 658
2
Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
My goal is to build a Forum website.
Bear, if I am developing RESTful webservices using Spring and consuming those on view layer using angular.js, do I still need to use JSP?
Or any other front-end technology I can use. I understood for the backend, what should be the technology stack for FrontEnd?
 
Bear Bibeault
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator

Puspender Tanwar wrote:if I am developing RESTful webservices using Spring and consuming those on view layer using angular.js, do I still need to use JSP?


No. The purpose of JSP is to render the page with dynamic information in the server. AngularJS, Angular, or React do so on the front-end.

what should be the technology stack for FrontEnd?


The two clear winners at this time are Angular and React. Which you choose dictates your stack. In either case you need to set up a (rather complex) front end environment that includes transpilers (for either ES6 or TypeScript depending upon framework) and a bundler like webpack.

For either framework there are "starter apps" that help set up this environment for you.
 
Puspender Tanwar
Ranch Hand
Posts: 658
2
Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator

Bear Bibeault wrote:The two clear winners at this time are Angular and React. Which you choose dictates your stack. In either case you need to set up a (rather complex) front end environment that includes transpilers (for either ES6 or TypeScript depending upon framework) and a bundler like webpack.

For either framework there are "starter apps" that help set up this environment for you.


Thank you Bear. It will be helpful for me
 
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
And what did you choose? I have the same choice now. Website, although not forum.
 
Ekaterina Galkina
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
Your colleague's variant looks like "Single-page application". Does it mean problems with search-engine ranking?
 
Bartender
Posts: 1868
81
Android IntelliJ IDE MySQL Database Chrome Java
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator

Ekaterina Galkina wrote:Does it mean problems with search-engine ranking?


For many people, search engine equals Google. It appears as though Google can crawl and retain information from SPA/JavaScript heavy web sites.
If you Google for javascript google search engine should see some results explaining what does and what does not work with Google.
Please remember that content is king when it comes to search engines and not all search engines treat JavaScript the same way.

The good thing about using something like Angular or React is that you can usually get a mobile friendly site with only a little extra effort.
However the effort usually is greater when you try to make a web site mobile friendly after the fact.

Now if you were to make a REST enabled web site then you could also, fairly and easily, connect your web site to IOS and Android apps.
Not that you would need to, if you use something like Angular or React to make your site mobile friendly in the first place.
 
Bear Bibeault
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator

Pete Letkeman wrote:However the effort usually is greater when you try to make a web site mobile friendly after the fact.


I have the scars to prove this.

All sites I make now use a mobile-first approach. Which not only helps make sure that the mobile version isn't a black sheep, but tends to naturally force the mobile and wide-screen UIs to have familial similarity.

Now if you were to make a REST enabled web site then you could also, fairly and easily, connect your web site to IOS and Android apps.


REST HTTP APIs are all the rage in most part because they are universally accessible from anything that speaks HTTP.

Not that you would need to, if you use something like Angular or React to make your site mobile friendly in the first place.


That's hardly automatic. It's quite easy -- in fact, very easy -- to make a site mobile-hostile with any framework. Modern frameworks are, however, designed to help make it easier to deal with mobile UIs.
 
Pete Letkeman
Bartender
Posts: 1868
81
Android IntelliJ IDE MySQL Database Chrome Java
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator

Bear Bibeault wrote:That's hardly automatic.


Sorry Bear, you are correct of course and I did not mean to imply that you did not have to do anything to make a site mobile friendly if you used on of those frameworks.
 
Puspender Tanwar
Ranch Hand
Posts: 658
2
Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
Hello Pete & Bear,
I still have not started the development, it's my learning phase as of now. while googling the stuff, I came across the Microservices concept. And also a news which stated that Amazon has shifted all it's code to microservices. Is it the another way to build websites?
 
Puspender Tanwar
Ranch Hand
Posts: 658
2
Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
Here is the link. Actually I was reading the diff b/w web services and micro services.
link
 
Pete Letkeman
Bartender
Posts: 1868
81
Android IntelliJ IDE MySQL Database Chrome Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator

Puspender Tanwar wrote:Is it the another way to build websites?


There are different methods to creating web sites.
It kind of depends on what your goal for the web site is.

Will you web site project be a new service for a new web site?
Will you be augmenting some existing service?

I'm not sure if there is a 'perfect way' to create a web site. Usually it boils down to what you know and/or what tools you have on hand.
Some companies may require you to use C# and some may require you to use Java, etc.
Even then there are many avenues with those technologies which work well together, for instance, Spring may not work too well with C# etc.

Building a web site is one thing, but building the client facing interface is something else entirely.
Many people spend years perfecting UI/UX. I'm more of a back-end person then a front end person and usually my UIs need some touch up after I'm done with them.
Being concerned with back-ends means that when I first try a project out, I try to figure out the data access part, including but not limited to what databases tables are needed and how they are created.
However this is my process only and I'm not suggesting that others will do the same way.
 
This will take every ounce of my mental strength! All for a tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
    Bookmark Topic Watch Topic
  • New Topic