This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes HTML, CSS and JavaScript and the fly likes Can I use javascript in other layers than presentation? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Can I use javascript in other layers than presentation?" Watch "Can I use javascript in other layers than presentation?" New topic
Author

Can I use javascript in other layers than presentation?

Rogerio Kioshi
Ranch Hand

Joined: Apr 12, 2005
Posts: 689
Hello,

I know javascript is very used on the presentation layer of an application.
But these days I was reading an old javascript book which have even references to methods for DAO pattern.
Do you think that, nowadays, these kind of methods are obsolete? Or maybe in the future we might use them, with the evolution of javascript libraries?


SCEA 5 (part 1), SCBCD, SCWCD, SCJP, CLP, CLS
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61084
    
  66

Way back in the old days, Netscape played around with server-side JavaScript. It sort of went the way of the dodo.

But in the "everything that's old is new again" department, Java 1.6 introduced a scripting framework and the Rhino engine in order to run JavaScript. So who knows what innovations (or atrocities) might arise from that.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Alaa Nassef
Ranch Hand

Joined: Jan 28, 2008
Posts: 460
Well, I'd like to add that I have friends in EDS Egypt, and they were working on a project for a legal authority in the UK, and the whole project was in javascript. The project was on for a couple of years now (maybe even more), so it seems that some systems are still being developed in javascript for the server side components. I do not know any other projects like this, but as Bear said, who knows what might happen in the future?


Visit my blog: http://jnassef.blogspot.com/
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41598
    
  55
Even before the javax.scripting API came along the Rhino JavaScript engine had very good Java integration, both through the BSF framework (a de facto standard for Java scripting integration) and through its own Java API (about which there was an article in the JavaRanch Journal written by -ahem- yours truely).

While I doubt that complete systems are/were being developed in JavaScript, it may have been used as the "glue" that holds together various components, or for parts that need few of the Java classes (maybe extensive calculations), or rapid prototyping. I'd be interested in pointers to further information about such systems, even though I agree that overuse can quickly become an abomination.

As to original question of whether the emergence of the multitude of JavaScript libraries might have an effect on this, I doubt it. Those are geared towards the browser and the page DOM, and not applicable to the server-side.
[ February 13, 2008: Message edited by: Ulf Dittmer ]

Ping & DNS - my free Android networking tools app
Alaa Nassef
Ranch Hand

Joined: Jan 28, 2008
Posts: 460
I doubt that complete systems are/were being developed in JavaScript, it may have been used as the "glue" that holds together various components, or for parts that need few of the Java classes


Well, I asked a friend of mine who was working on the project, and apparently the information that I had before was incorrect. I appologize, and I'm going to kill the one who gave me the false info .
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Can I use javascript in other layers than presentation?