systems level programming in Java

Discussion in 'Java' started by jrefactors@hotmail.com, Jan 8, 2005.

  1. Guest

    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!!
     
    , Jan 8, 2005
    #1
    1. Advertising

  2. Sudsy Guest

    wrote:
    > 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$...
     
    Sudsy, Jan 8, 2005
    #2
    1. Advertising

  3. Guest

    Sudsy wrote:

    >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?
     
    , Jan 9, 2005
    #3
  4. Sudsy Guest

    wrote:
    <snip>
    > 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!
     
    Sudsy, Jan 9, 2005
    #4
  5. Guest

    so you mean systems program usually are platform specific, it may have
    different sets of source code for different platform? What is JNI?
     
    , Jan 10, 2005
    #5
  6. Sudsy Guest

    wrote:
    > 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.
     
    Sudsy, Jan 10, 2005
    #6
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    2
    Views:
    452
  2. Mike
    Replies:
    2
    Views:
    651
  3. Matt
    Replies:
    35
    Views:
    10,679
    George Neuner
    Jul 22, 2004
  4. pabbu
    Replies:
    8
    Views:
    745
    Marc Boyer
    Nov 7, 2005
  5. Scorpiion
    Replies:
    1
    Views:
    1,373
    Scorpiion
    Dec 25, 2008
Loading...

Share This Page