-3

I want to completely sperate the front-end and back-end, the backend using Java EE stack expose restful web service, the front-end web application interact with back-end using json.

In such a front-end application, is it possible to using client side language only(html+css+javascript) ?

closed as too broad by gnat, Doc Brown, Greg Burghardt, user22815, MetaFight Oct 1 '17 at 2:50

Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

3

Frankly, I do not quite understand your question (because the answer seems obvious to me, but that says nothing about others). But from what I understand, you would like to have two major parts of your application:

  • A major part running in the browser

  • A second part with business logic in the backend

That is just how many contemporary applications are built.

So the answer to that question

In such a front-end application, is it possible to using client side language

is simply: Yes. It is possible to build a major part of your application in the browser, using HTML, CSS and Javascript alone.

But not only that. There are other usescases:

  • offline first where you could build your application (at first) only in the browser, having e.g. PouchDB as a "Database"-Layer (in fact it is a facade over some browser technologies using the "couchdb-protocol"), which could easily sync with an "online" couchdb

  • nobackend which is from a similar ecosystem

Or take a look at draw.io a diagramming app which runs completely in the browser and allows you to use Dropbox as persistence backend.

I want to completely sperate the front-end and back-end, the backend using Java EE stack expose restful web service, the front-end web application interact with back-end using json.

This is quite common.

0

Yes. Its 100% possible and that's the right way to do. Your front-end should be decoupled from the back-end.

Also consider having different models when returning data to the front-end. So your API models are loosely coupled with your data models.

You can easily use something like Automapper to map api models to db models and vise versa.

All you business logic will be in the back-end. Your back-end service will support any front-end like web or mobile.

  • 1
    I would be careful - especially in software development - calling something "the right way". It is a common way and has its pros and cons, but when you think of homomorphic webapps it is a different approach, which is not really decoupled and has in turn its own pros and cons. – Thomas Junk Oct 1 '17 at 6:18
-3

Your best bet would be to let us know what type of application you are trying to build.

As the 1st answer stated, it is definitely possible. However, depending on the functionalities that your app requires, this may not be the best implementation.

Not the answer you're looking for? Browse other questions tagged or ask your own question.