94
www.codingthearchitecture.com An introduction to the Java platform for .NET developers

An introduction to the Java platform for .NET developersstatic.codingthearchitecture.com/presentations/dw2009-java-for... · An introduction to the Java platform for .NET developers

  • Upload
    docong

  • View
    228

  • Download
    6

Embed Size (px)

Citation preview

Page 1: An introduction to the Java platform for .NET developersstatic.codingthearchitecture.com/presentations/dw2009-java-for... · An introduction to the Java platform for .NET developers

www.codingthearchitecture.com

An introduction to the Java platform for .NET developers

Page 2: An introduction to the Java platform for .NET developersstatic.codingthearchitecture.com/presentations/dw2009-java-for... · An introduction to the Java platform for .NET developers

Simon Brown

Hands-on software architect

Page 3: An introduction to the Java platform for .NET developersstatic.codingthearchitecture.com/presentations/dw2009-java-for... · An introduction to the Java platform for .NET developers

My background is predominantly

Java(client-server, websites, distributed systems,

messaging, SOA, etc, etc)

Page 4: An introduction to the Java platform for .NET developersstatic.codingthearchitecture.com/presentations/dw2009-java-for... · An introduction to the Java platform for .NET developers

I’ve been using

.NET for 6 months(Internet banking platform; ASP.NET, C#, Windows

Communication Foundation, SQL Server, etc)

Page 5: An introduction to the Java platform for .NET developersstatic.codingthearchitecture.com/presentations/dw2009-java-for... · An introduction to the Java platform for .NET developers

All technologies have

benefits

Page 6: An introduction to the Java platform for .NET developersstatic.codingthearchitecture.com/presentations/dw2009-java-for... · An introduction to the Java platform for .NET developers

All technologies have

trade-offs... your project context will determine their importance

Page 7: An introduction to the Java platform for .NET developersstatic.codingthearchitecture.com/presentations/dw2009-java-for... · An introduction to the Java platform for .NET developers

More and more systems seem to be

heterogeneous

Page 8: An introduction to the Java platform for .NET developersstatic.codingthearchitecture.com/presentations/dw2009-java-for... · An introduction to the Java platform for .NET developers

Java projects are introducing .NET

Page 9: An introduction to the Java platform for .NET developersstatic.codingthearchitecture.com/presentations/dw2009-java-for... · An introduction to the Java platform for .NET developers

.NET projects are introducing Java

Page 10: An introduction to the Java platform for .NET developersstatic.codingthearchitecture.com/presentations/dw2009-java-for... · An introduction to the Java platform for .NET developers

Middle Tier

Web Services, RESTor Messaging

Rich Desktop Application

Heterogeneous architectures are becoming more common...

Page 11: An introduction to the Java platform for .NET developersstatic.codingthearchitecture.com/presentations/dw2009-java-for... · An introduction to the Java platform for .NET developers

The credit crunchis less choosey

about technology

Page 12: An introduction to the Java platform for .NET developersstatic.codingthearchitecture.com/presentations/dw2009-java-for... · An introduction to the Java platform for .NET developers

Stakeholders need

business benefit

Page 13: An introduction to the Java platform for .NET developersstatic.codingthearchitecture.com/presentations/dw2009-java-for... · An introduction to the Java platform for .NET developers

And they want it faster and

cheaper than ever

Page 14: An introduction to the Java platform for .NET developersstatic.codingthearchitecture.com/presentations/dw2009-java-for... · An introduction to the Java platform for .NET developers

As an industry, we have an odd tendency to be

dogmatic about technology decisions

Page 15: An introduction to the Java platform for .NET developersstatic.codingthearchitecture.com/presentations/dw2009-java-for... · An introduction to the Java platform for .NET developers

In the current economic climate,we need to be

pragmatic and opento change

Page 16: An introduction to the Java platform for .NET developersstatic.codingthearchitecture.com/presentations/dw2009-java-for... · An introduction to the Java platform for .NET developers

The goal of this session isto provide you with a

jump-startinto the Java platform

Page 17: An introduction to the Java platform for .NET developersstatic.codingthearchitecture.com/presentations/dw2009-java-for... · An introduction to the Java platform for .NET developers

This isn’t a sessionabout how Java isbetter than .NET

(case in point; Silverlight vs JavaFX!)

Page 18: An introduction to the Java platform for .NET developersstatic.codingthearchitecture.com/presentations/dw2009-java-for... · An introduction to the Java platform for .NET developers

The first part of this session is

presentation and

demos,

the second part is an opportunity for

discussion

Page 19: An introduction to the Java platform for .NET developersstatic.codingthearchitecture.com/presentations/dw2009-java-for... · An introduction to the Java platform for .NET developers

What is Java? Where do I get it from? How do I install and run it? How do I write apps? What development tools are available? How do I build a website? Where can I find more information?

Page 20: An introduction to the Java platform for .NET developersstatic.codingthearchitecture.com/presentations/dw2009-java-for... · An introduction to the Java platform for .NET developers

Overview of Java

Page 21: An introduction to the Java platform for .NET developersstatic.codingthearchitecture.com/presentations/dw2009-java-for... · An introduction to the Java platform for .NET developers

Like C#, Java is a high-level programming language thatgets compiled down to an

intermediate representation

called bytecode

Page 22: An introduction to the Java platform for .NET developersstatic.codingthearchitecture.com/presentations/dw2009-java-for... · An introduction to the Java platform for .NET developers

That bytecode is run on a

Java virtual machine (JVM) that just-in-time compiles it into

native executable instructions

(similar to the CLR; this is why and how Java can run “anywhere”)

Page 23: An introduction to the Java platform for .NET developersstatic.codingthearchitecture.com/presentations/dw2009-java-for... · An introduction to the Java platform for .NET developers

Different editions,

depending on runtime environment

Page 24: An introduction to the Java platform for .NET developersstatic.codingthearchitecture.com/presentations/dw2009-java-for... · An introduction to the Java platform for .NET developers

Java Platform,Standard Edition

(Java SE)

Page 25: An introduction to the Java platform for .NET developersstatic.codingthearchitecture.com/presentations/dw2009-java-for... · An introduction to the Java platform for .NET developers

Desktop and server applications

Page 26: An introduction to the Java platform for .NET developersstatic.codingthearchitecture.com/presentations/dw2009-java-for... · An introduction to the Java platform for .NET developers

Java Platform, Enterprise Edition(Java EE, formerly J2EE)

Page 27: An introduction to the Java platform for .NET developersstatic.codingthearchitecture.com/presentations/dw2009-java-for... · An introduction to the Java platform for .NET developers

“Enterprise-class” server-side applications

Page 28: An introduction to the Java platform for .NET developersstatic.codingthearchitecture.com/presentations/dw2009-java-for... · An introduction to the Java platform for .NET developers

Java Platform,Micro Edition

(Java ME, formerly J2ME)

Page 29: An introduction to the Java platform for .NET developersstatic.codingthearchitecture.com/presentations/dw2009-java-for... · An introduction to the Java platform for .NET developers

Applications for mobile and

embedded devices

Page 30: An introduction to the Java platform for .NET developersstatic.codingthearchitecture.com/presentations/dw2009-java-for... · An introduction to the Java platform for .NET developers

JavaFX(the new boy in town)

Page 31: An introduction to the Java platform for .NET developersstatic.codingthearchitecture.com/presentations/dw2009-java-for... · An introduction to the Java platform for .NET developers

Rich user interfacesacross desktops and mobile

devices

Page 32: An introduction to the Java platform for .NET developersstatic.codingthearchitecture.com/presentations/dw2009-java-for... · An introduction to the Java platform for .NET developers

Java SE

Java ME

JavaFX

Java EE

Rich applications

Web applications

Server-side, “enterprise” applications

ASP.NET, ASP.NET MVC SharePoint .NET Remoting,

Messaging, BizTalk, SQL Server

Windows Forms, Windows Presentation Foundation, Silverlight

Windows Mobile/.NET

Compact Framework

Page 33: An introduction to the Java platform for .NET developersstatic.codingthearchitecture.com/presentations/dw2009-java-for... · An introduction to the Java platform for .NET developers

The JVM can run more languages than just

Java

Page 34: An introduction to the Java platform for .NET developersstatic.codingthearchitecture.com/presentations/dw2009-java-for... · An introduction to the Java platform for .NET developers

Groovy, Scala, JRuby, Jython, JavaFX Script

(... plus implementations for lots ofother programming languages)

Page 35: An introduction to the Java platform for .NET developersstatic.codingthearchitecture.com/presentations/dw2009-java-for... · An introduction to the Java platform for .NET developers

Getting Java

Page 36: An introduction to the Java platform for .NET developersstatic.codingthearchitecture.com/presentations/dw2009-java-for... · An introduction to the Java platform for .NET developers
Page 37: An introduction to the Java platform for .NET developersstatic.codingthearchitecture.com/presentations/dw2009-java-for... · An introduction to the Java platform for .NET developers
Page 38: An introduction to the Java platform for .NET developersstatic.codingthearchitecture.com/presentations/dw2009-java-for... · An introduction to the Java platform for .NET developers

Testing the installation

Page 39: An introduction to the Java platform for .NET developersstatic.codingthearchitecture.com/presentations/dw2009-java-for... · An introduction to the Java platform for .NET developers

Like the .NET Framework, it is

possible to install multiple versions of Java

Page 40: An introduction to the Java platform for .NET developersstatic.codingthearchitecture.com/presentations/dw2009-java-for... · An introduction to the Java platform for .NET developers

Unfortunately, each overwrites the Java registry settings

(this sometimes happens when you install applications that rely on Java)

Page 41: An introduction to the Java platform for .NET developersstatic.codingthearchitecture.com/presentations/dw2009-java-for... · An introduction to the Java platform for .NET developers

Set the JAVA_HOME environment variable to point

to the version you need

Page 42: An introduction to the Java platform for .NET developersstatic.codingthearchitecture.com/presentations/dw2009-java-for... · An introduction to the Java platform for .NET developers

Where is JAVA_HOME?

Page 43: An introduction to the Java platform for .NET developersstatic.codingthearchitecture.com/presentations/dw2009-java-for... · An introduction to the Java platform for .NET developers

Set the JAVA_HOME environment variable to point

to the version you need

Page 44: An introduction to the Java platform for .NET developersstatic.codingthearchitecture.com/presentations/dw2009-java-for... · An introduction to the Java platform for .NET developers

A quick Java console application

Page 45: An introduction to the Java platform for .NET developersstatic.codingthearchitecture.com/presentations/dw2009-java-for... · An introduction to the Java platform for .NET developers

Writing Java code

Page 46: An introduction to the Java platform for .NET developersstatic.codingthearchitecture.com/presentations/dw2009-java-for... · An introduction to the Java platform for .NET developers

Compiling Java code

Page 47: An introduction to the Java platform for .NET developersstatic.codingthearchitecture.com/presentations/dw2009-java-for... · An introduction to the Java platform for .NET developers

Running Java code

Page 48: An introduction to the Java platform for .NET developersstatic.codingthearchitecture.com/presentations/dw2009-java-for... · An introduction to the Java platform for .NET developers

Java code is typically packaged in a

JAR filefor deployment

Page 49: An introduction to the Java platform for .NET developersstatic.codingthearchitecture.com/presentations/dw2009-java-for... · An introduction to the Java platform for .NET developers

In a similar way to adding assembly references to .NET projects,

you add JAR files to the

classpathfor Java projects

Page 50: An introduction to the Java platform for .NET developersstatic.codingthearchitecture.com/presentations/dw2009-java-for... · An introduction to the Java platform for .NET developers

Development tools

Page 51: An introduction to the Java platform for .NET developersstatic.codingthearchitecture.com/presentations/dw2009-java-for... · An introduction to the Java platform for .NET developers

You have a

choice

Page 52: An introduction to the Java platform for .NET developersstatic.codingthearchitecture.com/presentations/dw2009-java-for... · An introduction to the Java platform for .NET developers

Multiple IDEs, both open source and

commercial(Eclipse, IntelliJ IDEA and NetBeans)

Page 53: An introduction to the Java platform for .NET developersstatic.codingthearchitecture.com/presentations/dw2009-java-for... · An introduction to the Java platform for .NET developers

Supporting tools

MSBuild, NAnt Ant, Maven

NUnit, TestDriven.Net JUnit, TestNG

NCoverClover, Cobertura,

Emma

CruiseControl.NETCruiseControl,

Continuum, Bamboo, Hudson

Page 54: An introduction to the Java platform for .NET developersstatic.codingthearchitecture.com/presentations/dw2009-java-for... · An introduction to the Java platform for .NET developers

A quick Eclipse demo

Page 55: An introduction to the Java platform for .NET developersstatic.codingthearchitecture.com/presentations/dw2009-java-for... · An introduction to the Java platform for .NET developers

Java web applications

Page 56: An introduction to the Java platform for .NET developersstatic.codingthearchitecture.com/presentations/dw2009-java-for... · An introduction to the Java platform for .NET developers

Java EE web applications are

comparableto ASP.NET web applications

Page 57: An introduction to the Java platform for .NET developersstatic.codingthearchitecture.com/presentations/dw2009-java-for... · An introduction to the Java platform for .NET developers

With the exception that Java EE applications are

portable(Tomcat, Jetty, Resin, Glassfish, JBoss AS, Oracle

AS, WebLogic, WebSphere, etc)

Page 58: An introduction to the Java platform for .NET developersstatic.codingthearchitecture.com/presentations/dw2009-java-for... · An introduction to the Java platform for .NET developers

Dynamic content through

JSP pagesrather than ASP pages

Page 59: An introduction to the Java platform for .NET developersstatic.codingthearchitecture.com/presentations/dw2009-java-for... · An introduction to the Java platform for .NET developers

Scripting syntax,

special XML tagsand an

expression languageare available to invoke Java code

Page 60: An introduction to the Java platform for .NET developersstatic.codingthearchitecture.com/presentations/dw2009-java-for... · An introduction to the Java platform for .NET developers

There are

no code-behindsthough

Page 61: An introduction to the Java platform for .NET developersstatic.codingthearchitecture.com/presentations/dw2009-java-for... · An introduction to the Java platform for .NET developers

There are (too) many

MVC frameworks

available to build more modular applications(Struts 2, Spring MVC, Stripes, ...)

Page 62: An introduction to the Java platform for .NET developersstatic.codingthearchitecture.com/presentations/dw2009-java-for... · An introduction to the Java platform for .NET developers

There are component frameworks

that provide data-bound controls,AJAX controls, etc

(JSF, Tapestry)

Page 63: An introduction to the Java platform for .NET developersstatic.codingthearchitecture.com/presentations/dw2009-java-for... · An introduction to the Java platform for .NET developers

Java EE web applications can be further configured through a

web.xml file

(similar to Web.config)

Page 64: An introduction to the Java platform for .NET developersstatic.codingthearchitecture.com/presentations/dw2009-java-for... · An introduction to the Java platform for .NET developers

Another quick Eclipse demo

Page 65: An introduction to the Java platform for .NET developersstatic.codingthearchitecture.com/presentations/dw2009-java-for... · An introduction to the Java platform for .NET developers

Beyond the basics

Page 66: An introduction to the Java platform for .NET developersstatic.codingthearchitecture.com/presentations/dw2009-java-for... · An introduction to the Java platform for .NET developers

Each Java Virtual Machine runs as a

separate process(every time you run java.exe)

Page 67: An introduction to the Java platform for .NET developersstatic.codingthearchitecture.com/presentations/dw2009-java-for... · An introduction to the Java platform for .NET developers

Each Java Virtual Machine has its own runtime options

Page 68: An introduction to the Java platform for .NET developersstatic.codingthearchitecture.com/presentations/dw2009-java-for... · An introduction to the Java platform for .NET developers

-server and -client

Page 69: An introduction to the Java platform for .NET developersstatic.codingthearchitecture.com/presentations/dw2009-java-for... · An introduction to the Java platform for .NET developers

-Xms and -Xmx

Page 70: An introduction to the Java platform for .NET developersstatic.codingthearchitecture.com/presentations/dw2009-java-for... · An introduction to the Java platform for .NET developers

Garbage collection

tuning(serial/stop-the-world, concurrent, etc)

Page 71: An introduction to the Java platform for .NET developersstatic.codingthearchitecture.com/presentations/dw2009-java-for... · An introduction to the Java platform for .NET developers

You have a

choiceof Java Virtual Machine

Page 72: An introduction to the Java platform for .NET developersstatic.codingthearchitecture.com/presentations/dw2009-java-for... · An introduction to the Java platform for .NET developers

Java Virtual Machines can be monitored using

JConsole

Page 73: An introduction to the Java platform for .NET developersstatic.codingthearchitecture.com/presentations/dw2009-java-for... · An introduction to the Java platform for .NET developers
Page 74: An introduction to the Java platform for .NET developersstatic.codingthearchitecture.com/presentations/dw2009-java-for... · An introduction to the Java platform for .NET developers
Page 75: An introduction to the Java platform for .NET developersstatic.codingthearchitecture.com/presentations/dw2009-java-for... · An introduction to the Java platform for .NET developers

If JVMs are separate processes,why do you need

ClassLoaders?

Page 76: An introduction to the Java platform for .NET developersstatic.codingthearchitecture.com/presentations/dw2009-java-for... · An introduction to the Java platform for .NET developers

Like AppDomains, ClassLoaders allow multiple applications to be run in

isolationwithin a single process

Page 77: An introduction to the Java platform for .NET developersstatic.codingthearchitecture.com/presentations/dw2009-java-for... · An introduction to the Java platform for .NET developers

Where next?

Page 78: An introduction to the Java platform for .NET developersstatic.codingthearchitecture.com/presentations/dw2009-java-for... · An introduction to the Java platform for .NET developers

It depends

Page 79: An introduction to the Java platform for .NET developersstatic.codingthearchitecture.com/presentations/dw2009-java-for... · An introduction to the Java platform for .NET developers

If you’re looking at Java

generic development...

Page 80: An introduction to the Java platform for .NET developersstatic.codingthearchitecture.com/presentations/dw2009-java-for... · An introduction to the Java platform for .NET developers

Java SE tutorialsJDBC

Spring FrameworkAnt/JUnit/CruiseControl

Page 81: An introduction to the Java platform for .NET developersstatic.codingthearchitecture.com/presentations/dw2009-java-for... · An introduction to the Java platform for .NET developers

If you’re looking at Java

web development...

Page 82: An introduction to the Java platform for .NET developersstatic.codingthearchitecture.com/presentations/dw2009-java-for... · An introduction to the Java platform for .NET developers

Java EE (JSP and Servlets)

Struts 2 and Spring MVC (a couple MVC frameworks)

Grails and JSFApache Tomcat or Glassfish

Page 83: An introduction to the Java platform for .NET developersstatic.codingthearchitecture.com/presentations/dw2009-java-for... · An introduction to the Java platform for .NET developers

If you’re looking at

enterpriseJava development...

Page 84: An introduction to the Java platform for .NET developersstatic.codingthearchitecture.com/presentations/dw2009-java-for... · An introduction to the Java platform for .NET developers

Java EE (JMS, EJB, Web Services)

Spring FrameworkHibernate

Page 85: An introduction to the Java platform for .NET developersstatic.codingthearchitecture.com/presentations/dw2009-java-for... · An introduction to the Java platform for .NET developers

If you’re looking at Java

client development...

Page 86: An introduction to the Java platform for .NET developersstatic.codingthearchitecture.com/presentations/dw2009-java-for... · An introduction to the Java platform for .NET developers

SwingSWT

JavaFX(make sure the technology decision is justified)

Page 87: An introduction to the Java platform for .NET developersstatic.codingthearchitecture.com/presentations/dw2009-java-for... · An introduction to the Java platform for .NET developers

Some good resources are...

Page 88: An introduction to the Java platform for .NET developersstatic.codingthearchitecture.com/presentations/dw2009-java-for... · An introduction to the Java platform for .NET developers

InfoQ.comTheServerSide.com

JavaBlogs.com

Page 89: An introduction to the Java platform for .NET developersstatic.codingthearchitecture.com/presentations/dw2009-java-for... · An introduction to the Java platform for .NET developers

To finish...

Page 90: An introduction to the Java platform for .NET developersstatic.codingthearchitecture.com/presentations/dw2009-java-for... · An introduction to the Java platform for .NET developers

.NET and Java;

the same but

different

Page 91: An introduction to the Java platform for .NET developersstatic.codingthearchitecture.com/presentations/dw2009-java-for... · An introduction to the Java platform for .NET developers

They can be used in isolation and in

harmony

Page 92: An introduction to the Java platform for .NET developersstatic.codingthearchitecture.com/presentations/dw2009-java-for... · An introduction to the Java platform for .NET developers

They can be used to solve the same and

different problems

Page 93: An introduction to the Java platform for .NET developersstatic.codingthearchitecture.com/presentations/dw2009-java-for... · An introduction to the Java platform for .NET developers

As technologists we need to be

pragmatic,

choosing the right technology for the context

Page 94: An introduction to the Java platform for .NET developersstatic.codingthearchitecture.com/presentations/dw2009-java-for... · An introduction to the Java platform for .NET developers

Websitehttp://www.codingthearchitecture.com

Google Grouphttp://groups.google.com/codingthearchitecture