The Artima Developer Community
Sponsored Link

News & Ideas Forum (Closed for new topic posts)
Java's Continuing Evolution

8 replies on 1 page. Most recent reply: Oct 1, 2002 10:50 PM by Bill Venners

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 8 replies on 1 page
Bill Venners

Posts: 2284
Nickname: bv
Registered: Jan, 2002

Java's Continuing Evolution Posted: Sep 30, 2002 1:46 PM
Reply to this message Reply
Advertisement
"The first notable effort to put mobile Java code to use was Jini. Even though applets are a form of mobile code, they are really just network-delivered applications. Jini made the first attempt at making mobile code an integral part of distributed applications. Application components could discover service components at run time and have delivered to them the code necessary to interface with a service. Jini's original licensing structure and requirement of an all-Java environment doomed it to become eclipsed by Web services. Where Jini looked to Java as a medium for interoperability, Web services looked to XML.

Platform-independent communication protocols have dominated network application development, and it certainly looks like this will not change. In the peer-to-peer (P2P) area, the JXTA project has organized itself around platform-independent communication protocols; Java implementations can interoperate with C implementations. Java will continue to add class frameworks for making use of new application-layer network communication protocols. But Java may make another attempt to take advantage of mobile code. Jini may very well have gotten it backward. Rather than services serving code to clients, clients should serve code to services," says Daniel F. Savarese in this JavaPro article:

http://www.fawcette.com/javapro/2002_11/magazine/features/dsavarese/default_pf.asp


Bill Venners

Posts: 2284
Nickname: bv
Registered: Jan, 2002

Re: Java's Continuing Evolution Posted: Sep 30, 2002 1:55 PM
Reply to this message Reply
> Jini's original licensing structure and requirement
> of an all-Java environment doomed it to become
> eclipsed by Web services.

To be precise, Jini assumes that clients will use JVMs to talk to services. It doesn't mean that services are implemented fully in Java, just that they expose a Java proxy. That proxy can talk across the network to a C program. It also doesn't mean that clients are implemented fully in Java. The surrogate architecture, for example, allow non-J2SE clients (such as a J2ME client or even yet another C program) to participate in a Jini network by sending a surrogate to a nearby JVM. The surrage must be Java, but not the real client, which interacts with its surrogate via a protocol.

The different parties of Jini systems use protocols to talk to each other. Jini just doesn't say what those protocols are. You could use XML in your protocol if you want, but you don't have to.

Bill Venners

Posts: 2284
Nickname: bv
Registered: Jan, 2002

Re: Java's Continuing Evolution Posted: Sep 30, 2002 2:00 PM
Reply to this message Reply
> Java may make another attempt to take
> advantage of mobile code. Jini may very well have
> gotten it backward. Rather than services serving code
> to clients, clients should serve code to services.

I'm not sure what he's getting at here. Does anyone have an idea?

One trouble with sending code to servers is you have to worry about malicious and inadvertent denial of service attacks.

Bill Venners

Posts: 2284
Nickname: bv
Registered: Jan, 2002

Re: Java's Continuing Evolution Posted: Sep 30, 2002 2:11 PM
Reply to this message Reply
> > Java may make another attempt to take
> > advantage of mobile code. Jini may very well have
> > gotten it backward. Rather than services serving
> code
> > to clients, clients should serve code to services.
>
> I'm not sure what he's getting at here. Does anyone
> have an idea?
>
On a second reading, I think I see what the author is getting at. The next paragraph suggests that sending code to servers is a "general and powerful" way for clients to customize the behavior of services.One thing that popped into my head upon reading this was, a client could pass code to a Jini service that the service proxy executes in the client's VM. That would at least avoid the denial of service on the server issue.

But I'm not sure I understand or agree with the main claim of the paragraph, which is that because service providers can't predict all usage modes of clients, clients will want a way to customize service behavior. Here are the relevant sentences:

>If a service component is to be incorporated into
>many different applications, it will likely not
>anticipate all of their modes of use....I predict Java
>eventually will incorporate methods of customizing
>distributed service components based on
>application-specific requirements.

Any ideas?

Frank Sommers

Posts: 2642
Nickname: fsommers
Registered: Jan, 2002

Re: Java's Continuing Evolution Posted: Oct 1, 2002 12:28 AM
Reply to this message Reply
I'm not sure what message the author wanted to convey in this article. He first claims that Java's progress mirrors the emerging need for dynamic systems, but then concludes by saying that "creeping featurism may drive programmers away from Java to use newer languages that come along." When discussing the evolution of any system, it is often helpful to start off by defining that system. In the case of Java, the system consists of (1) the virtual machine, (2) the bytecode format, (3) the programming language, and (4) a set of class libraries.

In terms of evolution, (4) has been making the biggest progress, if measured by JSRs submitted to the JCP process. However, that may not be the category that has the most impact: An API helps make things easier, but it does not make otherwise impossible things possible.

On the other hand, evolutions in (1) and (3) do yield gains in term of capabilities that were not otherwise possible. I'm not a VM expert, but it's pretty clear to me as a Java user that VMs have evolved tremendously over the past 2-3 years to the point where Java programs are the equal of applications written for many other systems from the viewpoint of performance, and continue to surpass other systems in terms of security, dynamic behavior, and extensibility. My understanding of some of the changes proposed for JDK1.5 is that they relate to VMs being able to more dynamic by revealing some of their capabilities to Java programs.

As for (2), the continued capability of Java bytecode is absolutely fascinating for me -- it is that capability that allows all sorts of programs written for Java to interoperate. The author of this article mentions Web services and JXTA protocols as technologies that foster interoperability. Yet, SOAP implementations (a key Web services technology) already experience interoperability problems.

Relying on protocols to foster interoperability might work for technologies that provide plumbing for low-level functionalities (e.g., TCP/IP, HTTP, FTP, etc.), but programmers almost always deal with programming constructs that abstract out protocol behavior into a progamming API (or some other programming construct). For instance TCP sockets abstract out the behavior of TCP communications, allowing a programmer to pass around bits of data without having to know how that passing actually works on the level of TCP.

With Web services, you might have, say, a weather service protocol that lets you pass a zip code, and it then returns to you the current temperature for that area. That's fine and dandy, but most programmers will write a little wrapper around it in, say, Java (e.g., int getTemperature(int zip)), and then as good as forget about the SOAP protocol. In fact, many JSRs explicitly address that sort of wrapping functionality (e.g., JAX/RPC).

Given that 99% of programmers will never have to (or want to) know about protocols, Jini explicitly acknowledges the programming model of protocol wrapping, and does not talk about protocols at all. (The same way the Servlet API acknowledges that progammers prefer not dealing with raw HTTP messages, and prefer instead a wrapper API around the HTTP or socket communication protocols.)

In the JXTA community, too, most progammers implement applications using a JXTA language binding (such as JXTA's J2SE binding), i.e., an API wrapper around those protocols. So they don't have to deal with the JXTA protocols, but rather with the progamming model outlined by those language bindings. So Jini makes that explicit, and gives APIs to programmers to work with from the beginning.

I don't understand why the author makes a big deal out of Jini depending so much on Java - Jini depends a strong type system defined in Java bytecodes (2), and that proved to be a good choice as a medium of interoperability, since it has thus far remained a stable type system. You can write your code (i.e., define your type) in the Java language, or any language for which a compiler exists that can generate Java bytecode. Jini relies on Java types for service identification, because until recently there was no other universally agreed-upon type system that provided "strong" typing support for a distributed system. With the emergence of XML schema, there is a possiblity to use XML schema as well - or, more likely, one could automatically wrap XML schemas into Java types and vice versa (which is what Java/XML language binding JSRs propose). So, that way, Jini will easily be used for services defined via XML interfaces. More likely, you'd compile interface from XML definitions to Java bytecode on the fly for that kind of interoperation.

What the author does not mention is the difference between code mobility and object mobility, and the emerging need for the latter. Folks (users of computers) want to have their stuff done, i.e., want to access their data, or solve their problems, etc., regardless of the computing infrastructure at hand. If one machine fails, or one network route fails, you'd want a system to survive failure. We're pretty good in routing packets around network failure, but we still need figure out how to better route chunks of computation. An object represents a (state) machine (as we're reminded many places on Artima.com), and thus is a good unit for computation chunks. I think in terms of Java's evolution, we should focus increasing efforts on improving "object jumpability" -- the ability of a computation to move about on the network, to take advantage of whatever resources are available, in support of a goal. Given a goal, e.g., a function, such as f(x), how can we automatically split the execution of that function into N number of chunks such that execution of that function takes advantage of all the computing resources, and such as that execution meets certain quality of service guarantees? For instance, you might want to say that f(x) should return with a 99.99999% probability, and should take 0.1 seconds, and perhaps that it should cost 0.0001 currency units to perform. Specifying those sorts of constraints are where some of the interesting research challenges lie, and that's where a lot of Java's future will also be determined. But then, again, predications about the future always sound foulish when read the morning after the predictions were made.....

Bill Venners

Posts: 2284
Nickname: bv
Registered: Jan, 2002

Re: Java's Continuing Evolution Posted: Oct 1, 2002 12:06 PM
Reply to this message Reply
> Relying on protocols to foster interoperability might
> work for technologies that provide plumbing for
> low-level functionalities (e.g., TCP/IP, HTTP, FTP,
> etc.), but programmers almost always deal with
> programming constructs that abstract out protocol
> behavior into a progamming API (or some other
> programming construct). For instance TCP sockets
> abstract out the behavior of TCP communications,
> allowing a programmer to pass around bits of data
> without having to know how that passing actually
> works on the level of TCP.
>
This is an interesting point for me, because I always think about the benefit of abstraction as being primarily in helping developers deal with complexity. But as Frank points out, it also helps developers make fewer mistakes. If I have to write code that explicitly deals with bits and bytes of socket communication, I'm likely to make more mistakes than if I can use a higher-level, more abstract socket API. Mistakes in using protocols can lead to interoperability problems.

Frank Sommers

Posts: 2642
Nickname: fsommers
Registered: Jan, 2002

Re: Java's Continuing Evolution Posted: Oct 1, 2002 12:45 PM
Reply to this message Reply
Well, I should have said in the above post that I'm fascinated by the continued compatibility of Java bytecode....

As this article also indicates, there is a certain confusion about protocols vs. APIs. IMO, the relationship between the two is that APIs are an interface, or wrapper, around protocols. I also think that Jim Waldo's oft-quoted article, "The End of Protocols," should have been titled "The End of Protocols for Programmers." Protocols are a specification of how bits, or chunks of data, are shuffled on the network. But programmers often don't want to deal with that complexity, but prefer instead a wrapper around that shuffling activitity. An API raises the protocol - "binds it," if you will - to the level of programming language constructs. A similar pattern is evident in how languages deal with XML data structures (or any data structure, for that matter): APIs such as SAX or DOM "bind" XML constructs into programming language constructs. APIs are also how most programmers deal with operating systems, file systems, and the like.

Many programming languages (e.g., Java) affects things either on a very low level, shuffling bytes and characters, or on a high level - on the level of programming language constructs, or objects. In other words, you can't define primitives in Java that correspond to protocol elements. You have a choice of dealing with raw bytes or objects. An API's implementation can deal with raw bytes, and it then presents those dealings in terms of objects. That way, programmers don't have to deal with protocols, only with objects (i.e., APIs). Jini makes APIs the basic building block. Of course, beneath those APIs are a lots of bits and bytes going around - only, programmers never have to be aware that, if they don't want to.

Bill Venners

Posts: 2284
Nickname: bv
Registered: Jan, 2002

Re: Java's Continuing Evolution Posted: Oct 1, 2002 1:36 PM
Reply to this message Reply
> As this article also indicates, there is a certain
> confusion about protocols vs. APIs. IMO, the
> relationship between the two is that APIs are an
> interface, or wrapper, around protocols. I also think
> that Jim Waldo's oft-quoted article, "The End of
> Protocols," should have been titled "The End of
> Protocols for Programmers." Protocols are a
> specification of how bits, or chunks of data, are
> shuffled on the network. But programmers often don't
> want to deal with that complexity, but prefer instead
> a wrapper around that shuffling activitity. An API
> raises the protocol - "binds it," if you will - to
> the level of programming language constructs. A
> similar pattern is evident in how languages deal with
> XML data structures (or any data structure, for that
> matter): APIs such as SAX or DOM "bind" XML
> constructs into programming language constructs. APIs
> are also how most programmers deal with operating
> systems, file systems, and the like.
>
Both protocols and APIs are ways programmers can write code that interacts with systems of functionality, be they objects or servers. The question isn't so much, is it an API or a protocol, but what level of abstraction must the client programmer deal with to use the protocol or API?

A protocol can be very simple. An API can be very complex. An API wrapper around a protocol can fail to hide any of the protocol's details.

In general, though, APIs raise the level of abstraction of the guts of the functionality to which they give programmers access. (Raising the level of abstraction should be a goal when designing APIs.) Abstraction helps client programmers deal with complexity, helps them make fewer mistakes. It helps service providers deal with change, because client code is coupled only to the interface. The more abstract the interface, the more ways it can be implemented without breaking client code.

Bill Venners

Posts: 2284
Nickname: bv
Registered: Jan, 2002

Re: Java's Continuing Evolution Posted: Oct 1, 2002 10:50 PM
Reply to this message Reply
> This is an interesting point for me, because I
> always think about the benefit of abstraction as
> being primarily in helping developers deal with
> complexity. But as Frank points out, it also helps
> developers make fewer mistakes. If I have to write
> code that explicitly deals with bits and bytes of
> socket communication, I'm likely to make more
> mistakes than if I can use a higher-level, more
> abstract socket API. Mistakes in using protocols can
> lead to interoperability problems.

While riding my bike tonight it occurred to me that I'd heard this point about abstraction reducing mistakes before. I once heard Bjarne Stroustrup talk about abstraction that way. When I arrived home, I searched the site and found the place I'd written about it:

http://www.artima.com/jini/jiniology/objdoc2.html

Here's the relevant paragraph:

After the keynote, I asked Stroustrup why he felt working at as high a level of abstraction as possible was a fundamental programming ideal. He answered that it allows details to be hidden, which makes code shorter. "The more details, the more mistakes," he said. Plus, code size impacts maintainability: the more code you have, the harder it is to maintain. He also mentioned that code at higher levels of abstraction is amenable to tools that analyze and optimize. He summarized by saying that code written at a higher level of abstraction is easier to understand, write, and maintain.

The point that mistakes when dealing with interfaces and protocols lead to interoperability problems fits in with what Jim Waldo and I were discussing here:

http://www.artima.com/forums/flat.jsp?forum=32&thread=1735

Flat View: This topic has 8 replies on 1 page
Topic: Policy-Based Design Previous Topic   Next Topic Topic: I Like Your Type

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use