systems level programming in Java

J

jrefactors

Sometimes I heard people saying systems level programming in Java. And
I have seen some job posting also say that. Systems level programming
usually are done in C/C++. Can Java do that? Any examples?
please advise. thanks!!
 
S

Sudsy

Sometimes I heard people saying systems level programming in Java. And
I have seen some job posting also say that. Systems level programming
usually are done in C/C++. Can Java do that? Any examples?
please advise. thanks!!

An interesting question. One of the major attractions of a language like
Java is that it is platform agnostic; system programming is typically
platform specific. A device driver I write in C for HP-UX 8.0 is not
likely to run on AIX 5.0. Heck, a device driver for Linux kernel 2.4 is
not guaranteed to run on a 2.6 kernel!
You use the appropriate tools for the jobs at the appropriate layers.
Some people don't see the need for entity EJBs when they can implement
similar functionality in stateless session EJBs with "generic" JDBC
calls. Trust me, it doesn't always work that way...
I would suggest that you not consider use of Java to implement low-
level functionality. If you're willing to write to the JNI layer then
you're going to be bound to the platform at that juncture.
Peruse the javadocs to obtain confirmation that the Java framework
functions at a much higher layer than the "bits-and-bytes" details.
Why do you think that Sun provides methods such as
java.lang.System.getProperty( String s ) where s can be "file.separator"
or "path.separator"?
Answer: platform agnosticism.
And let's not even get into the use of the HAL (Hardware Abstraction
Layer) by M$...
 
J

jrefactors

Sudsy said:
A device driver I write in C for HP-UX 8.0 is not
likely to run on AIX 5.0. Heck, a device driver for Linux kernel 2.4 is
not guaranteed to run on a 2.6 kernel!

But the source code is unchange for different platform, but we need to
compile the code on different platform for different binary file.
correct?
 
S

Sudsy

But the source code is unchange for different platform, but we need to
compile the code on different platform for different binary file.
correct?

Only if you go to a great deal of effort and use a lot of #ifdefs.
That's where Java has a distinct advantage. The downside is that you
can't get at the lower layers of the platform unless you're willing
to use JNI. At that point your code is no longer platform agnostic,
one of the reasons for going to Java in the first place!
 
J

jrefactors

so you mean systems program usually are platform specific, it may have
different sets of source code for different platform? What is JNI?
 
S

Sudsy

so you mean systems program usually are platform specific, it may have
different sets of source code for different platform? What is JNI?

Absolutely! Different models of systems, within the same line, from the
same manufacturer might require different approaches. Seemingly simple
things like ISA vs PCI bus can have a profound impact on the required
code. Things get even gnarlier when you're crossing wider gaps.
Ever try to port software running on Solaris on an UltraSPARC 5 to a
Linux box built upon a wintel platform? Problems galore!
JNI is the Java Native Interface. It lets you integrate platform-
specific code (typically C/C++) with Java. But then you lose
portability...
Which is why I suggested from the outset that Java was not the right
language for system programming efforts; it's strengths lie in
completely different directions.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,902
Latest member
Elena68X5

Latest Threads

Top