Wednesday, February 25, 2009

Full Katesplayground Sets

Initializing a property of type Date with Spring or Enum

The Spring framework lets you build objects in the configuration. Objects are created and can be initialized.

This works fine and just for simple types such as String or int when it comes to Enum is simple but you must know when it comes to date is much more difficult.

I propose to briefly explain how these two cases.

The case of Enum in Spring

The example works for version 2.5.6 of Spring with JDK 1.5. I think version 2.0 or 2.5 have made simplifications that I use in this example.

For a simple property of a bean. If this property is of type RoleStatAppel which is an enumeration which takes the values: RoleStatAppel.ECOUTANT or RoleStatAppel.ADMINISTRATEUR. To set the value of this property roleUtilisateur, simply add the definition of the Bean:

\u0026lt;property name="roleUtilisateur" value="ECOUTANT" />

Spring takes care of everything, he knows the type of the property and is able to do correspondence with the value in value.

The same rule applies to an object created with arguments in its constructor:

The initial code is:

new NsGUIFactory (NsGUIFactory.NsImplementationMode.GuiEcho2)

Where

  • NsGUIFactory is a singleton that is desired is a set
  • GuiEcho2 enumeration value that is taken into NsImplementationMode constructor parameter.

solution to create this object using Spring is simply:

\u0026lt;bean id="FactoryBean" class="fr.natsystem.natjet.application.NsGUIFactory">
\u0026lt;constructor-arg> \u0026lt;value> GuiEcho2 \u0026lt;/ value> \u0026lt; / constructor-arg>
\u0026lt;/ bean>

For information, the latest example, in my case it was an enumeration defined in the class NsGUIFactory. The case of

Date in Spring

For dates, the problem is somewhat more complicated:

  • Spring is not able to automatically convert a value 01/02/2009 in a property of type Date
  • there is a format. It is for this reason that Spring is not able to do the conversion alone.
  • it may be interesting to retrieve the current date without having to modify its configuration file.

To solve the problem of values of complex types for which the conversion of a simple String is not immediate or ambiguous, Spring offers what it calls a bean factory post-processor that can complement existing standards for these types.

is this solution we will look to treat the case of dates. The Spring Factory CustomEditorConfigurer will be set thanks to an interface in the Spring configuration file applicationContext.xml.

\u0026lt;bean id="customEditorConfigurer"
class="org.springframework.beans.factory.config.CustomEditorConfigurer">
\u0026lt;property name = "customEditors" >
\u0026lt;map>
<entry key="java.util.Date">
            <bean class="org.springframework.beans.propertyeditors.CustomDateEditor">
                <constructor-arg index="0">
                    \u0026lt;bean class="java.text.SimpleDateFormat">
; \u0026lt;constructor-arg> \u0026lt;value> dd / MM / yyyy \u0026lt;/ value> \u0026lt;/ constructor-arg>
\u0026lt;/ Bean>
\u0026lt;/ constructor-arg>
\u0026lt;constructor-arg index="1"> \u0026lt;value> true \u0026lt;/ value> \u0026lt;/ constructor- arg>
\u0026lt;/ Bean>
\u0026lt;/ entry>
\u0026lt; / map>
\u0026lt;/ property>
\u0026lt;/ bean>

The tag map can list, if necessary conversion for several different types. This is a list of Entry.

  • The entry has a key: key which indicates the Java type that will be affected by conversion: in our case is the type java.util.Date. this means that as soon as Spring meeting a property of type Date, it will automatically call our PropertyEditor. The
  • PropertyEditor for this type is defined in the bean tag indicating the class used. Spring provides a class to date. This object takes two input arguments, a SimpleDateFormat that defines the format for the conversion and a second argument that is true. I do not know what that avleur (this may be the property that allows lenient or not to force an error on an invalid date)

We choose the format you wish to use in \u0026lt;constructor-arg> \u0026lt;value> dd / MM / yyyy \u0026lt;/ value> \u0026lt;/ constructor-arg>. I recall that

mm in java refers to minutes while MM refers to month.

Once this statement added in the applicationContext.xml file, simply set the value like this:

\u0026lt;property name="dateArrivee" value="22/02/2009" />

Now if I want automatqiuement day value, it is possible to define dateJour a bean as follows:

\u0026lt;bean id="dateJour" class="java.util.Date" scope="prototype"/>

Then use this object as property value, which gives in our case:

\u0026lt;property name="dateArrivee">
\u0026lt;ref bean="dateJour"
/> \u0026lt;/ property>

Monday, February 23, 2009

Pokemon Frigo Return Rom

Microsoft TechDays 2009

From February 10 to 12, stood at the Congress Palace of Paris, the third edition of Microsoft Techdays.
You can read my reviews of previous versions:

This year we had less than superlative to describe the TechDays: years past it was the most important Microsoft events in the world. This year we talked about the most important event for Europe.

format

He has not changed, I take much of my comments last year: This is a lecture series on three days, open every day by a conference plenary. Each plenary

has its own theme that gives a connotation to the sessions of the day:

  • 1st: 2nd
  • Development: IT
  • 3rd: R & D

Sessions

conferences or sessions each lasting one hour. Many are held in parallel: there were twenty rooms plus three amphibian (the number of sessions is constant compared to last year). It is absolutely not possible to attend all lectures. But these are recorded and should be available by webcast on the Microsoft site.

When registering online (free), it was possible to register for different sessions. These inscriptions provide no guarantee of a place. Spaces are provided on a first come. There is a vast improvement over previous years: the allocation of rooms seems to have taken into account the pre-registration, it has been found that in order to cope with the 3000 pre-registrations for the Windows 7, the has been scheduled twice a day in large lecture hall. This year I have not felt that there were people turned away entry, and I have only attended one session where there were few people standing.

Each conference lasts one hour. The technical level of players is very high. The speech is not polluted by marketing: it's raw technique. Anyway, the audience is very technical and do not miss the slightest deviation marketting.
An hour is short to make a technical presentation of a product: each presentation is accessible on a technical aspect of a product. Do not expect training on this aspect of the product: however it is quite possible to know what the product is capable of, and limits and the work required to use it.
To me this opportunity to understand both the adaptation of a product is needed and necessary efforts to implement them techdays make an event extremely interesting. Given the success
persistent sessions (including even on the third day), I infer that this opinion was shared by many.

This year the sessions of questions and answers at the end of the sessions have almost disappeared: the room empties quickly at the end of the presentation, and only a few diehards.

Stands

There was a large booth space (single level). The partners were fewer booths this year. I have seen the right level of contacts in the stands.

I feel that the space allowed to manipulate the various products has disappeared. Crowded

is undoubtedly an undeniable success for Microsoft: a world full of sessions and impressive. The second day, Microsoft announced the 6000 participants at initial plenary session (compared to 5400, the year before and 4500 of the first edition). In fact the lecture hall was full 3 days. The organization is

a marked improvement and leveraging Microsoft first two years has better calibrated rooms and sessions. The impression of clutter and too many people have completely disappeared. Topics

The topics covered are numerous: they range from production to the methodology. It goes to the product development revenues. It seemed to me this year, there were no sessions of R & D

The variety is great and does a session one aspect of the product. A product is usually covered by a series of several sessions.

popular products this year:

  • Windows 7 and Internet Explorer 8.
  • WPF and Silverlight
  • Windows Azure: The OS for the Cloud Microsoft

These three products caught my attention because they almost always appear in each session. Of course, we talk about Visual Studio, SharePoint, Biztalk ... but these first three products seem to be ubiquitous.

WPF and Silverlight

The choice of technology for developing user interface seems a great challenge with Microsoft. There is at least 4 different solutions:

  • WindowsForms
  • WPF and WPF Browser Application declination
  • ASP.net Ajax with or without
  • Silverlight

In all cases, it will probably use Visual Studio (which would have 60% market share) for the development of management rules. It may be necessary to use solutions of the Expression range if you want to do their own checks or make animations. My understanding is that for a developing an application management standard Visual Studio is sufficient whatever the solution.

criteria influencing the choice are:

  • control the client environment: access to resources of the post
  • The need for offline and synchronization capability
  • The degree of interactivity
  • The need to use animations and transformations
  • The experience of development teams
  • The deployment constraints: type of position and opportunity for local installation

The most discriminating criterion is the need to deploy:

  • Asp.Net can be deployed on any item with a web browser. The development is likely to turn into a mobile.
  • Silverlight: It requires the installation of a plug-in in the browser (its size is 4 to 5 MB). A plug-in available for IE, Firefox and Safari. It runs on Windows and MacOS. A port is underway for Linux. A priori development SilverLight will not turn on an iPhone or a Blackberry. Porting Windows Mobile is in transit.
  • WindowsForms: You must deploy the application and limited to windows machines
  • WPF: you must also deploy the application and the framework.
  • Net WPF Browser Application runs in a web browser but requires the installation of the framework. Net Local. This therefore excluded the MacOs platform.

From my point of view, if you do not need access to local resources of the job (file or other applications for example) I will opt for a web solution.

Silverlight animations can be powerful, to make real-time but the loading time of an application seemed long. I'm not sure this solution is viable through a low-bandwidth networks (like Edge). Silverlight since the v2 seems more mature: it has more controls.

enriched ASP.Net Ajax allows to build an application with HTML Javascript windowing and drag & drop. I am surprised that we discover for ASP.Net MVC interest.

Otherwise, the solution that Microsoft is currently pushing WPF (the WindowsForms are not expected to change). Unfortunately the solution seems to lack maturity even if there was a big improvement since the release of Visual Studio 2008 SP1. For example, it lacks the DataGrid DatePicker and even if they are available on CodePlex.

WPF requires framework 3.0.. NET It is based on DirectX and allows a display vector. This solution, which allows you to build presentations based carousel.

Working primarily in Java, the MVC pattern is an achievement for me, so I was surprised to see several sessions emphasize this pattern to ASP.Net development or Silverlight. Advanced

Silverlight

This is a series of tips for advanced programming Silverlight. These aspects are related to a MVC approach and willingness keep a history and deeplinking (can directly access a page by its URL).

We have two services ASPX:

  • a page that contains the Silverlight application. This page contains a JavaScript code and HTML code. The JavaScript code hides the HTML code.
  • a REST service that returns data to the Silverlight application

The correspondence between the names of urls to switch from one to another without difficulty.

Another element is the Unity framework that allows for the injection of dependencies. The mechanism associated with the concept of Weak Event can make bootstrapping and thus loading modules on demand. It is also possible to replace a service which allows for unit testing.

This solution is very similar in the Spring J2EE framework objectives. Nevertheless the approach of Unity is less configurable than Spring. With Unity everything happens programmatically, where runs through Spring configuration file.

Internet Explorer 8

The most important element of IE 8 for a developer is its new rendering engine: the parsing and rendering have been amended to comply with standards and improving speed.

This evolution allows IE 8 to pass Acid2 test breaks compatibility of the many sites designed for IE 6. A compatibility mode has been provided it is activated at several levels:

  • It is possible to activate the compatibility mode by clicking a button at the end of the url. This resets the rendering engine of IE 6.
  • It is possible to add a tag X-UA-Compatible in the page to indicate to IE 8 to use the rendering engine of IE 6.
  • You can add the tag for all pages on the site by editing the web.config IIS. This operation is also possible in Apache.
  • Microsoft maintains a list of sites that are not compatible, it is possible to tell the browser to use this list and add to the list.

IE 8 with the approach of isolation with Google Chrome tabs in separate processes.

  • it is possible to have a separate Authentication tab
  • not crash a tab does not affect other tabs

Also new in IE 8 for developers: a toolbar profiling and debugging .

This toolbar contains the MS Dev Toolbar for IE 7.0 but this time is directly integrated in IE 8. It adds features profiling and debugging.

For IE version 8.0 introduces two new features:

  • WebSlice: Set as favorite piece of the page. The browser treats the WebSlice as an RSS feed by going to check for an update.
  • Accelerator: Allows you to trigger actions on a selected display as an address on a map. This feature allows you to avoid copy / paste.

These features can only occur if the site makes available the service users, service requiring development:

  • WebSlice: we must change the HTML page by adding the Class attribute HSLICE. There are two other attributes of class that will allow the definition of the title and content. Activation can be achieved by modifying an attribute of class by adding new attributes or by adding new tags class.
  • Accelerator: the service must be defined in an xml file Open Service. This file is available at the browser allows the menu appears on the right click and tells the browser that will have the service call with the selection.

Both services have both the characteristic of requiring specific development that can only be used by users of IE 8.0

Windows 7 is the theme that has seen the strongest passion: 6 sessions in large lecture hall.

For Microsoft

the 3 main themes of this new version they call Windows Seven (marketing hit) are:

  • User Experience
  • Safety Management and Control
  • workstations

Coté user experience, Microsoft is advantage of the finding that 75% of users had 5-9 windows open at once. The redesign of the taskbar should resolve this issue as an opportunity to dock a window on one side of the screen.

Honestly these two features must be able to bring productivity gains worth in the use of windows.

Another item to the user experience, the search "unified" with the Vista Desktop Search. The presentation of this feature did not seem of great clarity and I do not quite understand its principle beyond the soup marketing.

Finally the user experience side, Windows 7 is touchscreen without programming. I played on the stand with the Dell Latitude XT2 (a tablet PC touchscreen presented in Windows 7): it is very pleasant and efficient: the reactivity is good and there are feelings of relatives of the iPhone.

However, beyond the tactile aspect, interface was not designed for this: menus and buttons still have their old size suitable for a mouse but not at all consistent with a finger. Microsoft would benefit from reading the boards for the Apple iPhone application development: the size of a finger being generally known, it brings a number of immediate constraints listed document Apple.

Maybe does it take to change a standard Windows interface when it perceives that went into touch mode.

For now, I think for a Tablet PC like the Dell XT2 altitude, the tactile aspect of Windows 7 is about great thing: you can take home as a book and browse the web of the finger (the iPhone proves very effective in this task). For other uses such as taking notes, the good old pens (also available on the XT2) is still higher.

For the management of workstation, we note first of all a better power management which allows a 15% increase in autonomy. The people of Dell, seemed very surprised (pleasantly) the autonomy of XT2. Windows 7 accomplishes this feat by disabling unneeded services.

it should be noted that Windows 7 runs on a netbook and start seemed fast: it certainly is a demonstration machine with 1 GB of RAM. we know that the starting time of the various Windows degrade gradually as plants and use. So start the test can not be considered significant than the fact that Windows 7 running on a netbook.

For deployments, Microsoft says that the same tools for deployment and management that work with Vista (not with XP) will work with Seven. Microsoft also relies on 3 other solutions (that I found require a little extra financial) to facilitate the transition and deployment :

  • App-V: Applications are virtualized and deployed centrally. The application runs on the Windows 7 post normally.
  • MED-V will open a virtual machine to run the application. This virtual machine can be of type XP. This solution reduces compatibility issues between applications and the operating system. The user is aware of nothing: it requires a desktop XP. He sees its application as any other Windows application 7.
  • VDI (Virtual Desktop Infrastructure): The PC is just a graphics terminal as with Citrix.

For security, Windows 7 brings 4 new:

  • Improved User Account Control, but I have not seen what improvements
  • Bitlocker: it allows you to encrypt the contents of a USB key
  • AppLocker: removes applications banned by allowing the definition of a list of applications permitted or prohibited. It can be limited to one version or to extend it to all under a publisher
  • IE 8 will allow a given site has an activex

On the side of mobility

I attended two presentations on the subject both very disappointing. Microsoft is far behind Apple (the iPhone is the user who speaking). A

presentations trying to show different applications for any mobile blade clone existing version on the iPhone.

The biggest criticism that can be done to Microsoft is not to understand the challenges of touch: While all applications and terminals were touch and it seems to be an irretrievable direction the mobile world, but their interface is inadequate: one inch to a certain size and must agree to all the buttons of a certain size, like menus and clickable lists. That's the rule. One has the impression that Blackberry and Palm have changed their OS to take that into consideration (just when all of like Apple), but Microsoft still lags behind forcing the OS manufacturer to dress to make it usable.

Windows Azure and cloud computing

This is a flagship of these topics and TechDays crowd was at the rendezvous.

Cloud computing is generally to host its applications in a large datacenter with an infrastructure provider. This differs from traditional hosting by emphasis on virtuallisation: it is not shared space or a dedicated physical machine but a virtual environment. We see virtualization loop closes with the major interest is that for the virtuallisation the cloud.

Cloud Computing market is focusing on the on-demand comparison to IBM: I do not know what power I'll need or if I need a strong power point, cloud computing is the solution appropriate because the allocation is dynamic and we pay for consumption.

The Cloud joins their slogan for Microsoft Software + Services, which remains for me a vast hoax Marketing Microsoft: You can do everything, or rather everything we buy: buy old software like Windows, Word, SharePoint, or we buy but also services like Microsoft Azure or Microsoft Live Office Live where you find the SharePoint service. Do not be afraid Mr. customer, everything is legitimate and strategic. In marketing language

S + S is to mix different approaches: making house and pay a service in some cases (Windows Live offers for individuals and Office Live for companies) and buy their own software in other cases.

A regular feature presentations Azure is the importance that Microsoft attaches and highlights its expertise in managing very large infrastructures:

  • 240 billion messages sent per month MS Messenger
  • 10 billion MSM page hits per month
  • 10,000 servers per month added to its infrastructure

We learn that Microsoft plans to open 3 new data center ($ 500 million each investment) and that Microsoft is now able to build a data center in 3 months, or there two years ago they had 18 months.

Microsoft wants to be perceived as a major player in the accommodation in the crosshairs Google and Amazon. For those who do not know, Amazon with its Amazon EC2 offering is probably the first arrived in this area of Cloud Computing.

Cloud Computing is a big investment area (a data center of about $ 500 million), which requires expertise in administration and management of such infrastructure.

Windows Azure is an offer in construction: what we can say is that this service because it's Microsoft that hosts your applications. Microsoft will bear the operating costs and administration. The approach is to allow through virtuallisation gains on the exploitation of scale through better knowledge management including energy.

The service includes both the physical hosting, but also what should be called a "virtual operating system" is probably what might be called Azure. On top of that operating system, there is a series of technical services (such as data storage) called Azure Services Platform.

Unlike dedicated hosting where you must manage its platform and its updates, then everything is included but it can not hope to remain on an earlier version: we find the principle of Continuing the beta of Web 2.0. We must therefore manage its various interfaces. Today

Azure is in beta, it is possible to request a token that entitles you to a project and 50 GB of storage. Attention must tokens for each service such as identification or storage.

We will now concentrate on the OS Azure for cloud development and application.

A project corresponds to a virtual machine whose creation was supported by Microsoft: You have two environments: production and pre-production with the latter a temporary url.

Programming is only for now. Net: there are project templates in Visual Studio that are dedicated to Azure. Microsoft dangled the opening in the future development PHP, Ruby or even Java. It is true that a host must be "open" and many players (I do not mean that Azure) took care to show that some solutions Microsft interface seamlessly with other technologies. It may be even possible to host through virtuallisation applications in non-managed code. Nevertheless

today to develop for Azure, will be using Visual Studio. NET on Vista. XP is not and will not be supported: it is possible to test the local development but this requires that IIS 7 does not run under XP.

APIs are oriented Azure Cloud found the following services:

  • Storage: even if it is based on a version of SQL server, it is not SQL. We found tables and blobs.
  • ID: we use the Windows Live login. He is currently working on the support of the OpenID standard
  • Communication Services by messages with tail
  • services for deployment with the production and preproduction
  • administration services including a service log. The logs are stored as a BLOB it is then easy to recover for analysis.
  • Data Sync: a service for casual users
  • Workflow that provides support for BSE
  • scenario which is a kind of bus in the cloud.

All services are accessible through a REST service (so it is possible to call from Java) including the storage service.

Programming should consider one aspect important: we must work in medium trust mode (the mode of sharing of web applications). It will then be very careful to Retry Policies: the behavior of an application when a user clicks more or less patient several times on a single button. This is very important and therefore on the Web cloud.

Azure are 2 roles: Roles

  • aspx web: Creating a web interface
  • Role worker. Cs batch: Creating a treatment

Offer Azure seems to be something very interesting: we feel any the strength and consistency of investment from Microsoft. This is probably Microsoft issues a major show of the major issues and identify as such.

The Functional Programming Functional programming is a reflection of the axes of R & D at Microsoft. His declination "commercial" is the F # language.

classical languages are imperative languages: we give explicit orders to the machine. We program the machine: it tells him what to do and in what order. This approach requires to declare variables. This approach is hardly parallelizable: it controls the machine step by step.

Functional programming wants declarative: the compiler or virtual machine can more easily optimize the parallelization of treatment. I think the importance for Microsoft this approach is the possibility that increased parallelization: For Microsoft, it is possible to push the timing of the processors, we must move towards multi-core approaches or multi -processor: in both cases, the parallelization is important to take full advantage of new architectures. It is for this reason that programming focntionnelle needs to define the asynchronous and meeting points / synchronization. Microsoft seems to consider

linq (solution of object / relational mapping close to hibernate and jpa) as an approach declarative type so that SQL is based on an imperative approach.

The F # is far from me appear more understandable than the C # (knowing that I know neither one nor the other and they are very close in terms of syntax). From my point of view, the F # is a long term project for Microsoft, which has no real immediate value today.

The presentation focused on the possibility and interest for not typing in F #: The var C # (solution which does not define the type of a variable by telling them the type of the left side of expression).

typing in F # allows a generic approach that can work with an unknown type that is resolved later in the code or elsewhere. Warning! the type is known by the editor, the intellisense works!

typing this in mind, Let should be seen as a binding resolution for typing and not as a simple assignment. Conclusion

the Techdays were as in previous years up to my expectations. Microsoft has improved its organization making it less sensitive to the busy event.

The two axes in the medium term future that I found interesting are: Silverlight and Azure. Functional programming is something that remains for me very far Windows 7 and the present.