Tuesday, October 19, 2010

DevReach 18+19 October Sofia, Bulgaria (part7)


Dynamic State Storage Using the ASP.NET Provider Model

Interesting session about creating a storage for an application and making it with a unified interface.
Dealing with problems when you have same kind of storage collections.
Using the isolateUser, isolateProvider.

Nice design for his library.

HTML5 and CSS3

SVG vs Canvas
SVG is slower for animatons
Canvas is not suitable for low number of items which can be interacted with

-ms ; -o ; -moz ; -webkit ---- these are specific for certain browser, default is used otherwise

LESS - JS library that reduces and makes CSS easier when supporting different browsers
Modernizr - make your site supporting older browsers (IE6 >)

Recognize older/new browser --- the property "autofocus" -- tricky attribute

CSS3 can put round edges for rectangles; 3D shadows; rotate images ... lots of nice animation

DRY principle - Don't Repeat Yourself
Assumption Driven Programming - don't assume something instead of asking the user
Dependency Injection principle
The God class - the one great class that does everything


DevReach 18+19 October Sofia, Bulgaria (part6)


HTML 5 crash course

HTML 5 is connected with everything that is modern and flashy today. 
Introduction of iPad is in the same day as the HTML5 introduction.
Adobe vs Apple conflict.

"Apple is becoming the most important company in the US"

www.html5rocks.com - some tricks, a site recommended.

Browser vendors love HTML 5 because they don't want their products to be 'old'.
HTML 5 is pushed into the history.

HTML5 is not ready yet. It's good

The sad facts:

60% of Internet is used with IE6, IE5 and IE7 - they don't support HTML5.
60% Windows XP
15% still use IE 6.
91% of the browser users use Windows - they have the grip

Silverlight updates are quicker - they are pushed with automatic updates with Windows.

In his oppinion "Html 5 > 4"

www.html5test.com - test the browser about html5 support
Chrome - 217 + 10 bonus
IE8 - 27 + 0 bonus
Opera 10.61 - 159 + 7 bonus

Microsoft will never get 100% for ACID3 test because they don't want to support SVG fonts.

HTML5 template is with a DTD... nobody validates it with a DTD. "A pain in the ass" - quote.
AJAX was never specified.... they reverse-engineered it.
HTML5 has a spec - that makes it a lot different. The error behaviour consistent.

He simplified the HTML5... - charset, language, DTD validation - cleaner.

New semantic tags:
Old way - meaningless IDs for "div" tag
Google statistics : code.google.com/webstats about names of ID
They took the statistics and used the mostly used words and make them special words. They made the best practices rules in HTML5.

WebMatrix - interesting free tool for building web sites. Part of the WebPlatform. It's a direct competitor to PHP.
Razor + MVC  --- "in a 6 months will be the hottest thing"

"Microsoft's primary goals this year - Azure, IE9 and HTML5"

Modernizer - javascript lib for audio
html5shim .code.google.com -- javascript for adding HTML5 tags to IE6 (which doesn't support it)

html5 - audio tag
html5boilerplate - best add-on pack for html5

"Silverlight version of video is adaptive to the broadband width"

Google created a site to refer to for fonts instead of distribute them in your own site as a local copy.


DevReach 18+19 October Sofia, Bulgaria (part5)


Designing Applications in the era of Many-core Computing:

This session was about making a unparalleled program use all cores of a CPU.
The presenter was a Romanian so his program was the recipee for making goulash.
He used threading on a higher level with a structure called a Task.
A tasks can be combined to be one after another by a lambda expressions.

Building RESTful Applications with the Open Data Protocol

The last session I attended was one regarding RESTful services.
The presenter was very high-spirited and it was a joy to listen to his explanations.
So REST services is exposing a service to be accessed  via pure URL address through the browser. 
Using the HTTP methods POST GET UPDATE DELETE to access the service if you have the access rights.

He demonstrated how to connect to such a service via a client.

He created an REST service. 
He showed an easy API to do paging for the service.

It was a very nice presentation. 


Monday, October 18, 2010

DevReach 18+19 October Sofia, Bulgaria (part4)


Easing into Windows Phone 7 Development

 The presenter : "How many of you hade a Windows Mobile device"
.... some hands raised
he: "I'm sorry." :)

Fair enough...

BUG: Oops, first Windows Phone 7 glitch - the hold of search button didn't make the menu came up.

For developers:
Expression Blend 4.
Has a good emulator
You need a developer account for 99$ from Microsoft to unlock your phone, to debug your device.
You need Zune to connect to a device to test your application.

NOT GOOD: There is a 10 application limit... you have to uninstall some of your applications that you are developing...
That sounds like a pretty bad deal...

BUG: He said himself he found a bug. After a few application deployments, it says it can't deploy more applications and it gets fixed when you disconnect the USB cable and reconnect it again.
This is getting more and more interesting...

The memory usage cap - 90 MB of processing memory space.

PROBLEM: But using more memory produces strange exceptions following his words... he lost a lot of time until he thought of checking the memory usage.

There are dark/light theme for the Windows Phone 7.
He showed that it's easy to adapt your application to the theme.

Changing icons automatically when theme is changed - use AppBar.
- app bar is like a pop-up menu or the drag-menu in Android , but it's inside the application.

The emulator can be rotated in horizontal mode and rotates the icons with nice motion.

He raised the question:
- how do you display tooltips when there is no mouseOver event?
Well, his suggestion is design and for example wait for a few seconds and make a label visible.

Panorama - a huge background image which is automatically moved depending on the count of the items in the panorama.

Different sets of keyboards are available - chat keyboard, normal, etc


DevReach 18+19 October Sofia, Bulgaria (part3)


.Net tips and tricks

1. SQL injection prevention
<%: ... %> -- for ASP.net and it prevents SQL injection etc
Use it instead of <%=...%>

2. Trace it
-- better for debugging

add as a attribute in the page xml ->  
makes the other traces to be colored in red

3. Caching
http://tinyurl.com/c275vt - Update Callback

He's showing some web caching with load testing.

<% OutputCache ... - he increased the performance for a page showing database entries from 25 requests/sec to 250 req/sec.

4. use IDisposable when net using WCF
and "using()"

5. Action / Func keywords for lambda
Don't Repeat Yourself - principle :) We know it. Nothing new.
Action is for better logging.

6. Extension methods:
Search for some extension methods to improve given sites. 

7. Testing different vesions of configurations
custom config sections

8. WebForms - don't use Labels too much
9. WebForms - ViewState - be careful with its usage
- move the viewState to the bottom of the page because of bots collect a few thousand bytes from a page to scan it. Put your data to the top!

10. Some tools he uses everyday
LinqPad - linqpad.net
Reflector - reflector.red-gate.com - similar to Java Decompiler - see the source of a class file
FireBug - for Firefox
Fiddler - for IE
ViewState Decoder - http://tinyurl.com/2msmev


DevReach 18+19 October Sofia, Bulgaria (part2)


Internet Explorer 9
Roman Russev from Microsoft Slovakia is speaking about it.
fast / clean / secure / interoperable

He takes notice of the new open policy of Microsoft - the open beta releases of Win7, IE etc

Interesting features are like pinning pages from IE directly to the taskbar of Windows7.

Visual Studio 2010 Light Switch
It's all about data and screens.
It's a tool for not-developers to create business applications - making it easier.

First step - "choose a language, you can decide how are you going to deploy it later"
Next step - describe the data for the application

It looks very point-n-click.

Next step - building a screen. Just adding a template hooks the data with the look.
Many out-of-the-box stuff added like - search bar, ribbon, tabs etc...

Looks pretty nice to have all these and not work hard to implement them.


Sunday, October 17, 2010

DevReach 18+19 October Sofia, Bulgaria (part1)

Expect my comments about DevReach, .net technologies and cloud computing.
I know this site is about Java and technology but I see it as a good opportunity to check what is the competition going to present to the public.

Expect updates!


Registration went smoothly. I'm eagerly expecting the beginning of the keynote in the 13th hall.

Interesting facts:
- 2010 is the 5th DevReach and it has double the speakers, sessions and attendees than the first DevReach back in 2006.

- There will be a prize for the first registers - a free Visual Studio 2010 Ultimate

Vertigo's CEO is talking about User Experience.
He's presenting lots of sites that are streaming video.
A new Jay-Z's book has a site written on Silverlight - with lots of video, maps etc - very awesome.
Keynote "You have to learn about design!"

5 important areas for design:
- Industrial design
Surrounds us; he's talking about showers - Desing + Intent ! Everything is meant with a reasaon. "Observe and ask yourself why!"
"Developers, we are very good at accepting bad user experience. We can adapt. Common user can't."

- Usability
Jakob Nielson
How long does it take you to accomplish your goal?
"Honestly, people don't care about software" :)
"Don't make me think" - by Steve Krug --- about easy usage of products
"You could be embarrassed  by testing your product with real users..."

Fonts fonts fonts
They can make your intention wrong or extremely right and immersive.
He explains the curves of fonts... He says that the emptiness is more important than the black ink part of a letter.
Helvetica is his favourite font.

-Natural UI
-Motion graphics

Introduction of mouse - not as intuitive as touch screens! The presenter's daughter got confused... nice example!
Touch - become interesting when iPhone came out.
"Nobody wants a 15 000 $ coffee table..." :) Funny guy is making us laugh.

Oh my god!
He's showing us Windows Phone 7 and its intuitive UI
"You are not using Helvetica" :) - nice point!

Key concept is a caption (text) which is partly cut out of the screen and it MAKES you to slide to see the rest of the application.


Thursday, October 07, 2010

Java2Days Sofia Day 1 (part 6)

17:00 - 6. Google App Engine for Java Ice Penov

GAE = Google App Engine
Google Eclipse Plug-in - comfortable for developing in Java.

GAE lets you run and maintain your web applications
GAE supports Java and Python

An application will become available on *.appspot.com

Benefits and advantages of GAE:
- cloud
- free resources
- Google infrastructure for scalability
- easy integration with Google accounts and other services

(demonstrates how to create a GAE application)

GWT = Google Web Toolkit (made for JavaScript and AJAX)

GWT compiles Java to JavaScript => slower compile . That is done because it's executed in a browser.

"OK. I'm speaking with the Google cloud... I should socialize more" - after creating a Google application that sends messages via Google Talk and you can return your parameters to your application as you respond via Google Talk as well. :)

GAE is in sandbox.
- cannot write to file system
- cannot open socket to another host
- cannot open a thread
- cannot make explicit System calls like System.exit()

There is a white-list of JRE features supported by the GAE cloud. (easily googleable)
- he thinks that this is a major drawback, because you can't make your application run on your server and then associate it with the cloud.

There are some metrics services on the GAE - CPU time, request-count etc...

Out-of-the-box Services API:

- storing data is done with Google BigTable which is a NoSQL
   JDO preferred to JPA; GQL is available - no real info given for this
 ------- cannot use JOIN query and aggregation queries

-  MemCache Java API - distributed in-memory data cache
      JCache API can be used

- Mail Service - Java Mail API can be used
- XMPP - Google Talk uses this IM protocol
- Image service - resize, rotate, flip, crop
- Google Account - you can integrate openID into your GAE application

GAE and other technologies interoperabilities:
- JEE - not supported JDBC, RMI,
- other JVM languages - supported

-3rd party
--- supported - Spring, Tiles, Struts, GWT
--- not supported - Hibernate, iText, Rich(ICE)Faces

And that's it for today!
Java2Days first day is over. I hope you find these notes interesting. I wrote them as I was attending the sessions so my posts could lack enough sentences but you will forgive me :)

Unfortunately, I cannot cover Java2Days Day 2 and  share my thoughts.

Leni Kirilov

Java2Days Sofia Day 1 (part5)

Quotes from other sessions not that interesting:

JSF has no pros
Oracle + Sun =  Snoracle

16:00 - 5. Building RESTFul Web Services with Java  Vassil Popovski, VMware

REST Principles:
-- everything is a resource
-- resources have identifiers
-- uniform access
-- resources have representations
-- link things together

HTTP methods

JAX-RS - java API for rest services. The presenter says that this SRS seems readable.


JAX-RS = POJO + Annotations

Best implementation of JAX-RS is CXF

Key concepts
- resource classes - have at least 1 resource method
- resource methods - annotated with @POST @GET etc
- provider classes  - extending JAX-RS interface

More commonly-used annotations:
@Path - relative path for a resources
@Consumers / @Produces - for media types
 - produces = output
 - consumes = input
@QueryParam - inject the value of a query into a variable

- scalable solutions
- compared to SOAP is much simpler


Java2Days Sofia Day 1 (part4)

4. Mission Critical Enterprise/Cloud ApplicationsEugene Ciuran

What is Cloud  and how do we use it?
- quick deployment
- virtualize hardware
- replace data center

- turn on/off machines (virtual hardware) as needed - all you need is a credit card

- horizontal - load-balancing
- vertical - improve applications - more hardware

high availability != uptime
If your network is down and servers UP - your application is not AVAILABLE for users.

Availability scale chart
90% - one nine  = 36.5 days down
99% - two nines = 4 days down
99,9% - ... =  9 hours
... 53 minues
... 5.3 minutes
....32 sec

from 90% - 99 -- you double the resources
Each step, the cost is doubled.

The best option at the moment is 99.9%
Well, at 2008 Amazon was down for 9 hours... it cost them much.

SLA = Service Level Agreement - agreement between customer and a vendor
SLA is not a legal document!

The most important question is "What do I do when an outage happens? How do I repair a disaster?"

At the point of 5-6 nines you see that cloud will cost you as much as building your own infrastructure!!!!

Hybrid cloud architecture - some data that is not mission-critical is stored in the User part, so when that part goes down , your applications are still working.

Amazon vs Google App Engine vs Rackspace
elastic load-balancer vs static stateless calls

Interesting case study about a project not scaling and going to migrate to a cloud.

"If there is a mission-critical application/data just write it on Java... .Net is great, but if your job depends on it - just write it on Java"   - The comment to do on a Java conference :)

- introduced ESB for scaling
- although ESB has many connections, it is not the single-point-of-failure - it is the load-balancer(which was another virtual machine)

(next - page)

Java2Days Sofia Day 1 (part3)

12:00 3. A Quick Tour of Contexts and Dependency Injection for Java EE Reza Rahman

The nice looking Indian dude Reza will explain the JEE6 introduced feature  CDI / DI.

CDI/DI is the most important new feature, if we believe him.
CDI is about application orchestrations.

@Qualifier - a mechanism to introduce additional logic in a bean

The general perspective is that JEE6 applications using CDI will include lots of annotations
like @Inject, @Qualifier, @Decorator @Produces, @xxxxScoped ...etc etc - may be 20 more


Java2Days Sofia Day 1 (part2)

11:00 - 2.Introduction to Spring Integration and What's new in Spring Integration 2.0
Josh Long & Oleg Zhurakousky, VMWare

Pipes and Filters - this is the basics of Spring - similar to Linux.
=> loose coupling mechanism

(Interesting way of question->answer way to present your product. The two presenters are great!)

Channels are comfortable for postponed communication. When both sides aren't presented at the same moment in time. a.k.a publish/subscribe.

Pipes are channels
Filters are endpoints.

Message endpoint types:
Transformers  - convert payload or modify headers
Filters - discard messages based on boolean evaluation
Router - determine next channel based on content
Splitter - generate multiple messages from one
Aggregator - assemble a single message from multiple

Spring Integration - it's integrated in the Spring framework.
(long demo with small letters... not everybody sees that good and they didn't zoom it permanently...)

(next part)

Java2Days Sofia Day 1 (part1)

11Here I'm going to blog my thoughts about the sessions:

9:30 - 0. Introduction

The introduction was translated live in both English and French by two girl-students. :) They were kind of shy and inexperienced but it was funny to watch them.

Unscheduled introduction by a dude from Oracle forced the Vitosha schedule to be 30 minutes behind the other xxx2Days presentations... Great organization ...

10:00 - 1. Java EE 6 - why and how J2EE became popular again

Regarding JEE6 the new Oracle employee Alexis Pouchkine said that NetBeans is the best for JEE6 development today. Eclipse is still behind. Go go, NetBeans!

Expect more annotations in JEE6.

Ruby developers don't create applications much faster than Java developers anymore. Just 5-10% faster.

JEE6 compliant application servers are : Glassfish, Oracle's WebLogic, and a few more.

He's making a comparison between JEE5 and JEE6. JEE5 was all about making the development faster and easier, but JEE6 includes a lot of new features.

Detailed explanations for
- Bean validation
     - something like assertions with annotations for fields of beans - @Valid annotation makes validation recursive
     - you can create your own validation annotations
 - Web Profile
 - CDI - very interesting annotations for defining exact implementations and validations etc... Interesting code samples

Expect JEE7 with cloud features. If I can suppose right, I expect Java7 features as well :) That means we won't see it for another 2-3 years.