Sunday, December 27, 2009

Best Model Haans Steam Mop

Press on donations and tax reduction in 2008

We will reply to you because our fiscal situation.

We made an erroneous assessment of the law on tax cuts for our donors. Indeed, we do not address in our places of action in this case in Morocco or Algeria.

We want to apologize for this inconvenience which offends us in deeper. We want to be accountable and as transparent to you what is quite normal.

Please accept our apologies for this error 1000 times. What you need to do for previous years if you received prior to 2009 tax receipts for donations that passes under the condition of good faith by the tax authorities. Therefore you can not claim for 2009 tax cuts.

We'll try for 2010 to have a room to be eligible for the law and for you to enjoy lower taxes and go well with a good foundation.

We hope you understand our approach and we make every effort to ensure that 2010 is again profitable for all. If you have suggestions to share with us we will be very attentive.

Association The Little Orphan of the Atlas, 29 rue Charles Tillon

93300 Aubervilliers
lesorphelinsdelatlas@hotmail.com

Where Can You Buy Mother Pucker Lip



Salam alaykum Mr. and Mrs. Larissa

All members of the association thank you for your donation on the occasion of Eid El.

Barakallah or fikoum, it allowed us to carry out various actions. May Allah Ta'ala be pleased Subhrana Wa.

Abandoned Babies:
In partnership with Al Noor Association, every month we send money to buy milk, hygiene products. We also pay $ 750 per month Dir Myriam, Mother widow who takes care of babies.

Seddiqi:
We sent the sum of 700 euros, which allowed Seddiq to be hospitalized and support her drug purchases. Regarding the purchase of prosthesis, we continue to raise funds. (Morocco)


Fatiha:
We collected the sum of 750 euros, we keep the entire sum to arrive at the total amount that is 1 200 euros. (Morocco)


Injections for mother with cancer
We sent him the money as and injections (the last is scheduled this month). Or 680 euros. (Algiers)


Zyad
This little 4 year old boy has a genetic disease, which is mainly characterized by sores on the skin, we regularly send money to these parents to help them buy dressings, medicines and clothing.
Zyad lives in a slum on the outskirts of Algiers, despite the fact that his dad works.



Myriam:
This widow, mother of 2 children, which we use to care for abandoned babies in the town of Taza, suffered his speech, which went very well, el hamdouillah, therefore it will lose no use of his ears. Total raised : 1 500 euros (Morocco)


Radia:
This mom has passed, el hamdoullillah open heart surgery. It is best to seven months. Total raised: 1 000 euros (Morocco)


Hamza
Hamza and his family are now receiving assistance from the Association of Children's Hospital of Rabat. We intervene more since February 2009. We followed them for over a year, we allowed them to obtain decent housing, and all this thanks to you. (Morocco)


Eid:
The sum collected amounted to EUR 2 000. 1 000 for Morocco and 1000 for Algeria.
20 families could have benefited from this assistance.


Barakallah or fikoum for your help. Allaah Wa Ta'ala Subrhana opens the gates of Paradise.


Hoping to keep you among our donors.

Sincerely.
Association The Little Orphan of the Atlas, 29 rue Charles Tillon
93300 Aubervilliers
lesorphelinsdelatlas@hotmail.com

Swollen After Giving Birth

Shares Shares in 2007

MOROCCO / ALGERIA


ORPHAN BABIES:

Remittances to El Association Noor in Taza, to meet the needs of babies from day day (purchase of diapers, milk, hygiene products). In addition, since June, we employ a widow with two orphans so they can assist nurses and provide for its own needs and those of his two children (80 euros per month)
Total Amount: EUR 2400

Remittances to the "Moroccan League for Child Welfare" in Oujda
to allow the purchase of milk for babies.
Total Amount: EUR 500



SICK WITHOUT RESOURCES:

We learned early 2007 that the little that Mehdi had enjoyed with his mother and sister of our Action Aid El Khebir 2006, is suffering from leukemia, with God's help we managed to raise funds that enabled a rapid response by the Hospital children with cancer in Rabat. El
hamdoullillah, he is now cured but must go to the hospital once a quarter to check that all is well.
Total Amount: EUR 1800



Help for consultations or purchase of drugs to various people without resources (Morocco).
Total Amount: 460 euros


Hamza is a young boy of 12, he was hospitalized for several months at Ibn Sina Hospital in Rabat
. This child has diabetes, which resulted in his cardiac complications. This is the
older siblings. He has three younger sisters. His father died several years ago following an accident. The family received no compensation and lives in a small room courtesy a family for a specified time. This room will soon be razed by the authorities. To date, we have no precise date and hope this family can keep a roof over your head long into the mother can not afford to care for her son, she could count on your help.
Total amount: EUR 800

For his weekly dialysis, little Hamza must pay 120 euros per month, excluding drugs ... The money has enabled her to receive care, but also allowed her mother to visit him regularly for more than 400 km separates the mother of his child. (Rabat Taza)

Zyad a baby is 5 years old, he lives in a "slum" in the suburbs of Algiers, that child is suffering from bullous dermatosis
. This disease causes including wounds on his little body. To help her family heal him, dressing him in clothes more comfortable, we launched a call to the gift which proved to match our expectations.
Total Amount: EUR 330


A few steps from Zyad, saw a little girl who needed an intervention in order not to lose sight. We gave him our support.
Total Amount: EUR 50



SCHOOL CHILDREN:

Education is a right for every child. We bought school supplies, backpacks and clothing
to vulnerable children to enable them to resume their way to school. This action has 7 children concerned, it is little but a good start!
Total amount: EUR 250


AID EL KEBIR 1427 (2007):

For this operation, which is close to our heart, members of the association were on the scene.

This year, ten families have benefited from your help. For each, a sheep was bought as a gift cash to spend Eid in the merriment.

Mom and 3 sisters from the small Hamza have benefited this year from this action.

Total Amount: 1390 Euro





THE ELDERLY

Some people without family, sometimes end their lives in "hospice." El Hamdoullillah some associations are there to allow these people to live in dignity. We therefore decided to contribute to the action of a small organization that helps older people to Zeralda, Algeria.
Total Amount: EUR 500

These funds enabled the purchase of clothing and hygiene products.

Association The Little Orphan of the Atlas, 29 rue Charles Tillon

93300 Aubervilliers
lesorphelinsdelatlas@hotmail.com

Tuesday, September 22, 2009

Wart Removal Walk In Clinic Toronto

Type Data JPA and Hibernate Tutorial

The efficiency of application development management and effectiveness of this application (response time) relies heavily on building a data model "effective".
In this post we will focus on a choice "effective" simple types to a Java application based on Hibernate and JPA.

This article completes a series of other posts on this same JPA Blog:


If the word "effective" has been repeatedly quoted, is that this word can take the following contradictory aspects point of view:

  • the effectiveness of a data model for the DBA (Database Administrator) will be based on storage space and fast query execution,
  • for a developer that will rely largely on the ease that he has to write queries that match the functional need for the user
  • it will be the response time of the application

My concern in this post is to provide some balance, a compromise between these aspirations keeping in view, the pragmatic need to which we must all face, develop an application at the best price for a demanding customer.
Initially, we will outline a number of simple rules to quickly select the data types of its properties. In a second step we will explain with examples the various reasons for these choices. This second part should allow a better understanding of the behavior of Hibernate and limits the portability of various solutions.

Constraints for the effectiveness of a data model

We focus in this post only the aspects of the typing of properties and simple columns.

To effectively select a data type must:

  • understand the nuances between different types
  • be able for a given real world (the value we want) to distinguish the different nuances associated with different types


For example, a double and BigDecimal both represent a decimal number. While the double has no limit to its precision: the same variable can contain a specific number or 10 to 2 decimal places, this is not the case of a BigDecimal, this object has an attribute that indicates precision the number of digits after the decimal point. To change its precision it is necessary to use a method.

For a float, 1.23 and 1.230 are identical, this is not the case for a BigDecimal as attribute accuracy is not the same.

Similarly, if we now know that a euro value will be lower than say at 1 000 000 €, we can hardly know the limits which must be taken into account in a decade especially if we take into account a change in currency.

therefore want for each amount set different limits depending on the information is not necessarily relevant: it increases the difficulty of the choice and we do not always possible to predict changes (increases the risk Error wanting to be precise).

For these choices remain relevant and effective over the lifetime of the application (often several years) requires that different developers handling such data efficiently handle the know. So we often interest:

  • be limited to a restricted set of types: a little too precise in some cases cause side-effects negative example in the size of strings: in the end, you never know what is the size of a field and suddenly the likelihood of a developer in a hurry to make mistakes in the control is greater.
  • use well-known types and controlled by the whole team: if a type is not well controlled, its use can be catastrophic because one of the first reflex is often to revert to a known type, which has the dual effect of adding extra work and the risks of developing side effects during conversion. Edge effects are obviously very people they wanted to avoid the choice of this type.


My experience gained through the audit of projects shows that often the best is the enemy of good. Optimization too far in forcing out the trails often more perverse effects for a project that more reasonable value.

Finally, typing an "information" is not intrinsic to its content. Its use is also important. Not take such a number composed entirely of numbers, this does not mean it will be stored as an integer base. In many cases it is best to store it as a string. This will depend on the controls that you want to do research that is desired to produce ...

other hand, if information must be stored in the database, it must also be manipulated in Java and displayed on a screen. For developing effective, it must pass from one representation to another and the controls are quick and effective. Hibernate and JPA facilitate this work, still do not he put too many roadblocks in forcing him to use incompatible types.

The rules adopted are:

  • limiting the number of types of known types
  • some portability across databases
  • typing coherent base for display via the memory representation in Java

typing data

We have five major types of data we subdivide into types Nearest Uses:
  • numeric types
    • Monetary amounts: these values in currencies such as prices, sales, amount, commissions ...
    • measures: it is a decimal value that corresponds to the measurement of an object that it was a remote, weighing ...
    • rates and percentages: it is decimal low (below 100) and sometimes requiring a bit more precision (some rates have 4 digits after the decimal point)
    • Quantities: This is for integer values to number of units of a product.
  • alphanumeric values
    • Strings: strings conventional store information in clear (unencrypted)
    • codes: it is a short information (less than ten characters) which is coded.
    • Comments: This is a text composed of several words.
  • values listed
    • Values True-False: this corresponds to the check boxes and dropdown lists
    • enumerations: This is information that the selection is a drop down list. is stored in a code base and is displayed with a label a parameter table that provides correspondence.
  • dates and timestamp
    • The traditional dates precise to the day
    • hours: one hour in the day regardless of the date
    • tags schedules (TimeStamp) that keep track of the exact time of a event. Those dates are accurate to the millisecond
  • identifiers
    • the file number sequences

Monetary Amount Type

Monetary amounts have a peculiarity: the number of digits after the decimal point is a constant (Often 2). The rounding problems must always be solved with this constraint: it is not possible to temporarily increase the number of digits after the decimal point.

other hand, the BigDecimal is absolutely accurate in comparing decimal number which is imperative for monetary amounts.

For more details on the value of using BigDecimal you can read my post: Tutorial BigDecimal

The storage hibernate a BigDecimal is a Number of 19 digits with 2 decimal places . We will use this format for all amounts.

The number of digits (19) may seem excessive when account in Euro, Yen, but it is reduced even more for other currencies.

He seems wiser to stay on the default size.

Sample definition of a value:


@ Column (name = "JLTS_AMOUNT", precision = 19, scale = 2) private BigDecimal
amountDefault;


The BigDecimal is an object, it can be null as the corresponding columns in the database. There will be no problem to adapt if the value can be null.

Database Type Base Note
Oracle NUMBER (19.2) The number is truncated if greater accuracy is
MySql decimal (19.2 ) An exception is thrown if the accuracy is greater
Hsqldb

numeric

Storage knows neither accuracy nor control is stored exactly what we received
Sql Server numeric (19,2) The number is truncated if the precision is larger, the number is completed for accurate

Measurement Type A measure similar to a monetary amount, with one difference: the precision of digits after the decimal point is not of great importance (do not forget that the precision of a physical measurement is rarely above 1%).

It may be wise to store a measure in a double or Double, which facilitates programming.

Sample definition of a value:

@ Column (name = "JLTS_MESURE" nullable = false) private double

measure;

Database Type Base Note
Oracle double precision
MySql double precision
Hsqldb double
Sql Server double precision

Standard Rates and Percentage

percentage rates and are usually associated with monetary data type. Often these multiplications to achieve a monetary amount to obtain a new sum. Typically, a percentage rate can be stored with 2 or 4 digits after the decimal point and does not exceed the 3 digits before the decimal point. To simplify modeling, we use the following definition:


@ Column (name = "JLTS_TAUX" precision = 7, scale = 4, nullable = false)
; private BigDecimal rate;


nulllable Note the attribute set to false by default: it is likely that the default rate is set to 0 and not left to Null. Null makes delicate operations performed while with the default value 0, the result would be functionally correct in many cases.

Database Type Base Note
Oracle NUMBER (7.4) The number is truncated if greater accuracy is
MySql decimal (7.4) An exception is thrown if the accuracy is greater
Hsqldb numeric
Sql Server numeric (7.4) The number is truncated if the accuracy is greater, the number is completed for accurate

Type Quantity entire

These integer values as the number of items purchased. We opt for a Long type if the value can be null otherwise we will opt for a long. Warning! In this case, it should be noted nullable attribute to false. It is likely that in many cases, the absence of quantity or the value 0: In this case, the length will be more appropriate.


@ Column (name = "JLTS_QUANTITY", nullable = false) private long
longNumeric;

or

@ Column (name = "JLTS_QUANTITYNULL") private Long
longObject;

Database Base Type Note
Oracle NUMBER (19.0) The number is truncated if greater accuracy is
MySql bigint
Hsqldb bigint
Sql Server numeric (19,0) The number is truncated if greater accuracy is

type String

This is all classical strings that correspond to information relatively structured as a name, first name, street name ... These chains are of reasonable size: less than 250 characters. Beyond that, it will probably be a data type of comment.

Storing a string is very simple: a String.

@ Column (name = "JLTS_NAME", length = 40)

private String name;

Database Type Base Note
Oracle varchar2 ( 40 char) Where 40 is the length. Oracle does not distinguish between strings empty string null. It only stores a null string. The char attribute specifies the length after taking into account the UTF-8.
MySql varchar (40) MySql is the difference between an empty string and a null string.
Hsqldb varchar (40) It sends no exception when string too large
Sql Server varchar (40)

Type Code

Some information is stored as a code:

  • postal code code coin
  • code
  • a state code of a bank
  • Siren
  • Siret

As a general rule codes are fixed length and relatively short (less than 10 characters). They can be alphanumeric or numeric.

They can also match the type "dropdown list" described below. The distinction is of no interest because the result is the same. It uses a String.

@ Column (name = "JLTS_SHORTCODE", nullable = true, length = 2) private String
ShortCode;

Database Type Base Note
Oracle varchar2 (2 char)
MySql varchar (2)
Hsqldb varchar (2)
Sql Server varchar (2)

Type Comment

There are high chances that any information that exceeds one hundred Character is a field of type comment. Even if it is comfortable to limit this field to a String and a storage base limited to one or two thousand characters, this approach is highly likely not to withstand future needs of users. It is therefore preferable to use a representation as a CLOB.

@ Lob @ Column (name = "JLTS_COMMENT)

private String comment;

Base Type Note
Database
Oracle CLOB
MySql longtext
Hsqldb longvarchar
Sql Server text ;

Type Boolean True-False

This is information that is usually displayed as a checkbox (CheckBox). The value can be True or False.

All bases but also the best known and most used (Oracle) does not have Boolean type. The information will be stored as a character (Y, N, for example) or number (0.1).

standard JPA annotation is here.

@ Column (name = "JLTS_BOOLEAN") private boolean
booleanType;

Database Type Base Note
Oracle number (1.0) 0 for false and 1 for true
MySql bit direct correspondence with true and false
Hsqldb bit
Sql Server tinyint 0 for false and 1 for true

There is a Hibernate annotation (not JPA), which allows indicate the storage base:

@ Type (type = "yes_no)
@ Column (name =" JLTS_YESNO)
public boolean yesno;

@ Type (type = "true_false") @ Column
(name = "JLTS_TF") public boolean
trueFalse;

Database Base Type Note
Oracle char (1 char) Storage form of a letter Y and N for yes_no
MySql CHAR (1) true_false T and F,
Hsqldb
Sql Server char (1)

Type dropdown list and list

This is the cases generally represented by a dropdown list (ComboBox HTML SELECT or component). There are a series of labels that correspond to a code.

The storage base is a code.

Generally the code belongs to another column (the notion of Foreign Key).

The storage will be in the form of string classical

@ Column (name = "JLTS_COMBOBOX", nullable = true, length = 2)
private String selection;

I do not recommend the use of many- to-one for this type of relationship: this relationship adds to the display when there is information that corresponds to a parameter table. The many-to-one should be reserved for connections between real objects.

Database Type Base Note
Oracle varchar2 (2 char)
MySql varchar (2)
Hsqldb varchar (2)
Sql Server varchar (2)

Type Date specifies the date

The case dates is very particular the type Date is a precision much greater than the need for storing dates is limited to an accuracy to within a day.

JPA Temporal annotation defines which limits the accuracy to date (DATE), time (TIME), where extreme precision and complete (TIMESTAMP)

Accuracy is important in the dates: it is desirable that a search on records with a Date column that corresponds to today's date 22/09/2009 returns all records via a tie.

If precision is too large (at second) it will not work.

@ Temporal (TemporalType.DATE)
@ Column (name = "JLTS_DATE", nullable = true) private Date
DayDate;

Database Type Base Note
Oracle date Storage is in a precision dd / MM / yyyy. Equality at work day in Oracle applications (using TO_DATE)
MySql date Equality at work day in MySql queries (using STR_TO_DATE)
Hsqldb date
Sql Server datetime Storage is in a precision dd / MM / yyyy. Equality at work day in the SQL Server (using Cast)

Type Time

This is a time of day, independent of the day. This type is rarely used. His lack of portability makes me prefer the TimeStamp.

@ Temporal (TemporalType.TIME)

@ Column (name = "JLTS_TIME", nullable = true)

private Date time;

Database Type Base Note
Oracle date This format does not work in Oracle
MySql time
Hsqldb time
Sql Server datetime

TIMESTAMP

This is often a specific date to the millisecond allowing keep track an event. This column is often in history tables or audit that keep track of changes made by users.

This type of trace is primarily necessary audit and traceability of information.

His second accuracy can not find just the records where the timestamp value is equal to a date.

@ Temporal (TemporalType.TIMESTAMP)
@ Column (name = "JLTS_TIMESTAMP", nullable = true) private Date
timeStampAudit;

Base Type
Database Note
Oracle timestamp
MySql datetime The accuracy of this format is lower than Oracle
Hsqldb timestamp
Sql Server datetime The precision of this format is lower than Oracle

Sequence Type id The id is the simplest key automatic digital . Oracle has the notion sequence for that. In other cases, it must pass through another table that stores the counter.

For portability, it is desirable to use the automatic type following: GenerationType.AUTO.

GenerationType.SEQUENCE works well with Oracle but not with MySQL.

GenerationType.IDENTITY: works well with MySQL but not Oracle.

@ Id @

GeneratedValue (strategy = GenerationType.AUTO)

@ Column (name = "LONG_ID", nullable = false) private long id

= 0;

This corresponds to a sequence

Database Base Type Note
Oracle number (19.0) There is created using a sequence Oracle hibernate_sequence.
MySql bigint
Hsqldb bigint generated by default as identity (START WITH 1)
Sql Server numeric (19,0) identity

Type File Number

There is information in a digital appearance (They are composed only of numbers) are usually handled as a string of characters as a number.

For example, there is no arithmetic operation on a file number or social security number: add a number, multiply, divide, or compare it not make sense.

It is more common to concatenations of strings: sex code, the code department for a Social Security number.

For a file number, you can find it practical to search by typing only part of the number using a Like.

For these fields, it is desirable to use a String.

@ Column (name = "JLTS_NUMERO", nullable = true, length = 10) private String
NumeroDossier;

Database Type Base Note
Oracle varchar2 (10 char)
MySql varchar (10)
Hsqldb varchar (10)
Sql Server varchar (10)

Nullity of a column

A column can be null which is different from 0 for a number and an empty string "" to a String. Oracle is a notable exception for string: Oracle inserts a null into a column when passed an empty string. This point is still valid with Oracle 10G and the driver ojdc14.jar. The Java types

accept they are a type of objects (BigDecimal, Double, Long ...) Null which is not the case for native types (double, long, integer ...). The String nullable.

From technical point of view, it is not advisable to use a native type if the column does not have the NOT NULL attribute: it might cause problems or inconsistencies if it gets a null value.

From a functional view, the null must be used to distinguish a non-input of others: We use the null if it is relevant to distinguish 0 from the absence seizure.

For example, it is not desirable that the note of a child is by default 0. It is important to be able to distinguish the lack of scoring (the null) of a zero mark (0).

In the case of a discount, it's probably the opposite, we want the default value is 0. This allows for simple calculations. Value may remain at 0 without much impact. In general, changing this value requires special duties (for example, be manager).

For strings should be avoided to distinguish the case of null and empty strings in order to maintain portability to Oracle. This is not necessarily a major problem. The status of an object (which can be detected by the difference between a field null and void) and is also probably best delivered by a specific column STATUS / CONDITION (this is the type code).

For numbers, the choice is more difficult: the absence

  • null facilitates the calculation: the calculation is not beson test the existence of the null
  • 0 can often be taken as a default
  • there are cases (as a footnote) or 0 can be considered a default, in this case the null is indispensable.

should not lose because the creator of the business object does not necessarily have every right to enter all values. it may be a data entry operator who lacks the qualifications to perform certain sensitive values. In this type of process, it may be important that the person who owns the rights to complete the record can distinguish a quick glance the information that has yet to grasp. In this case, the null can be useful even if in other cases, the value 0 will be very relevant.

In our previous example, the rebate will remain at 0.

If it takes a simple rule: I will give the following rule: The null is useful if the default value of the field can not be 0, in other cases it is preferable not to use Null.

Conclusion The design phase of the data model can be greatly simplified by limiting the definition of types to the list given above :

Rates and percentages
Type Notation JPA Oracle Mysql HsqlDb Sql Server

Montant monétaires

@Column(name="JLTS_AMOUNT", nullable=true, precision=19, scale=2)

private BigDecimal amount;

NUMBER(19,2)

decimal(19,2)

numeric

numeric(19,2)

Mesure

@ Column (name = "JLTS_MESURE", nullable = false) private double

measure;

double precision double precision

double

double precision

@ Column (name = "JLTS_TAUX", nullable = true, precision = 7, scale = 4) private BigDecimal

rate;

NUMBER (7.4)

decimal (7.4)

numeric numeric (7, 4)

Quantity

@ Column (name = "JLTS_LONG", nullable = false) private long

longNumeric;

NUMBER (19.0)

bigint bigint

numeric (19,0)

Strings

@ Column (name = "JLTS_STRING", length = 40) private String

textString;

VARCHAR2 (40 CHAR)

varchar (40)

varchar (40)

varchar(40)

Code

@Column(name="JLTS_SHORTCODE", nullable=true, length=2)

private String shortCode;

VARCHAR2(2 CHAR)

varchar(2)

varchar(2)

varchar(2)

Commentaire

@Lob

@Column(name="JLTS_COMMENT")

private String commentaire;

CLOB

longtext

LongVarChar

text

Vrai-Fausse et Booléen

@ Column (name = "JLTS_BOOLEAN)

private boolean BooleanType;

NUMBER (1,0)

bit

bit

tinyint

list déroulante

@ Column (name = "JLTS_SHORTCODE", nullable = true, length = 2)

private String short code;

VARCHAR2 (2 CHAR)

varchar (2)

varchar (2)

varchar (2)

Date

@ Temporal (TemporalType.DATE)

@ Column (name = "JLTS_DATE", nullable = true) private Date

DayDate;

DATE

date

date

datetime

Time

@ Temporal (TemporalType.TIME)

@ Column (name = "JLTS_TIME", nullable = true)

private Date time;

DATE

time

time

datetime

Tags schedules (TimeStamp)

@ Temporal (TemporalType.TIMESTAMP)

@ Column (name = "JLTS_TIMESTAMP", nullable = true) private

Date timeStampAudit;

TIMESTAMP datetime

timestamp datetime

File Number

@ Column (name = "JLTS_NUMERO", nullable = true, length = 10 )

private String number;

VARCHAR2 (10 CHAR)

varchar (10)

varchar (10)

varchar (10)

Sequence

@ Id @

GeneratedValue (strategy = GenerationType.AUTO)

@ Column (name = "LONG_ID", nullable = false) private long id

= 0;

NUMBER (19.0)

bigint bigint

numeric (19,0) identity

In the case of a phase re-engineering an existing data model, it will probably be possible to rely on the same types may be changing their representation JPA in order to adapt to the existing database.

For example, if the base amounts are NUMBER (11.2), type the amount can be either

@ Column (name = "JLTS_MONTANT" precision = 11, scale = 2 , nullable = false) private BigDecimal amount
;

In practice, it should not appear more than two versions of the same type in an existing model.

I hope this tutorial will simplify the design of your next data models. A future post will provide a test project to better understand the different behaviors.

Tuesday, July 7, 2009

Patty Cake Vapirew Set

amounts and use of BigDecimal in Java:

The purpose of this note is twofold. First, there is an awareness of the compelling need to use BigDecimal instead of double management applications.

Secondly, we will give some recommendations for effective use of BigDecimal.

Why use BigDecimal and not double

Handling amount of programming has often encountered some problems of comparison, two numbers are supposed to be equal as tested different example is different from 7273.27x10 72732.7.

The storage mechanism traditional binary numbers: a sum of power of 2, is responsible for this problem.

Numbers as simple as 0.1 can not be stored precisely in that form. Therefore 0.1 is never exactly equal to 0.1. So 0.1 x10 is not exactly equal to 1. Out 1 = 2 ^ 0, so it has an accurate representation. If we made a comparison with 0.1 x10 1 gives a result in this case wrong.

NB It seems as if the 0.1 is better treated now since Java, if using double, it has 0.1 x10 = 1.0.

In business applications, numbers are often the amounts or percentages: the number of digits after the comma is usually known (between 2 and 4, see 6 or 8 for some financial applications).

In case of division, there are rules of rounded and it is not desirable to change the storage to gain "precision". These applications do not know the actual: 1 / 3 will be equal to 0.33.

The BigDecimal in Java

In Java, there is a type BigDecimal which can take into account this type of problem: it relies on the fact that an integer has an exact binary representation.

For an amount, simply set the number of digits after the decimal point and store the number as a whole: 7273.27 example will be stored as a value of 727,327 with 2 digits after the decimal point. The number of digits after the decimal point corresponds to the scale property of the BigDecimal.

Using BigDecimal causes a small constraint: it is not a native type but an object. It is therefore not possible to use the operators +, -, * and /.

example

7273.27 * 10.0 which is written with double: double

doubleApproche = 7273.27;
double result = 10 * doubleApproche;

becomes BigDecimal:

BigDecimal = new BigDecimal doubleApproche ("7273.27");
doubleApproche.multiply BigDecimal result = (new BigDecimal (10));

Project Example

We'll create a simple Eclipse project to illustrate the different cases.

menu: File -> New Project

Then select the node in Java: Java Project.

The project name will TestBigDecimal.

Press the Finish button.

On node src, right click and select New -> New JUnit Test Case

the radio button

Things New JUnit 4 test.

Package: fr.j2ltho.test.bigdecimal

Name: TestDifferences

Then press the Finish button.

A dialog box appears: "JUnit 4 is Not On The build path. Do you want to add it?".

Choose the radio button: Perform Action THE FOLLOWING:

And check that there is: Add To The JUnit 4 library build path.

Validate by pressing the OK button.

It adds the following code: package

fr.j2ltho.test.bigdecimal;

import static org.junit.Assert.assertEquals;

import java.math.BigDecimal;

import org.junit.Test ;

TestDifferences public class Test {@
(timeout = 1000) public void
testProblemeDouble () {double
doubleApproche = 7273.27;
        double resultat=10*doubleApproche;
        assertEquals("Double fois 10", 72732.7, resultat);
        if (resultat==72732.7) {
            System.out.println("Egale:  " + resultat);
        }
        else {
            System.out.println("Ecart:  " + (resultat-72732.7));           
        }       
    }
    @Test(timeout=1000)
    public void testProblemeBigDecimal() {
        BigDecimal doubleApproche=new BigDecimal("7273.27");       
        BigDecimal resultat=doubleApproche.multiply(new BigDecimal(10));
        assertEquals("BigDecimal fois 10", new BigDecimal("72732.7"), resultat);
        if (resultat.compareTo(new BigDecimal("72732.7")) ==0){
            System.out.println("Egale:  " + resultat);
        }
        else {
            System.out.println("Ecart:  " + (resultat.subtract(new BigDecimal("72732.7"))));           
        }       
    }
    @Test(timeout=1000)
    public void testDixiemeDouble() {
        double doubleApproche=0.1;       
        double resultat=10*doubleApproche;
        assertEquals("Double fois 10", 1.0, resultat);
        if (result == 1.0) {
System.out.println ("Egal:" + result);

} else {
System.out.println ("Écart:" + (result-1.0));
        }       
    }
    @Test(timeout=1000)
    public void testCentiemeDouble() {
        double doubleApproche=0.01;       
        double resultat=10*doubleApproche;
        assertEquals("Double fois 10", 0.10, resultat);
        if (resultat==0.10) {
            System.out.println("Egale:  " + resultat);
        }
        else {
            System.out.println("Ecart:  " + (resultat-0.10));           
        }       
    }
    @Test(timeout=1000)
    public void testDixiemmeCentiemeDouble() {
        double doubleApproche=0.11;       
        double resultat=10*doubleApproche;
        assertEquals("Double fois 10", 1.10, resultat);
        if (result == 1.10) {
System.out.println ("Egal:" + result);

} else {
System.out.println ("Écart:" + (result-1.10));

}}}

The execution of Test: Run As -> JUnit Test provides a successful test at 100% but with the following result in the Console:

Gap: 1.4551915228366852E-11
Equals: 72732.70
Equals: 1.0
Equals: 0.1 Equal
: 1.1

This shows that the comparison JUnit assertEquals: assertEquals ("Double time 10", 72732.7, result); returns a just result when comparing the double return an error and the difference in returns to differ.

If handling of Java double, beware of assertEquals who seem to take into account a rounding difference.

Creating a BigDecimal

The BigDecimal is an object, it is created with a new. Its constructor accepts a String, a long or a double.

should never use the constructor twice because it reintroduces the problem of the round.

The following test illustrates the problem:

@ Test (timeout = 1000)
testProblemeConstructeurDouble public void () {BigDecimal
doubleApproche = new BigDecimal (7273.27);
BigDecimal = new BigDecimal stringApproche ( "7273.27");
assertEquals ("BigDecimal x 10" doubleApproche, stringApproche)
if (doubleApproche. compareTo (stringApproche) == 0) {
System.out.println("Egale:  " + doubleApproche);
    }
    else {
        System.out.println("Ecart:  " + (doubleApproche.subtract(stringApproche)));           
    }       
}

The console displays:

Gap: 4.3655745685100555419921875E-13

Again, we see that for assertEquals BigDecimal is unreliable because it indicates an equality that is not real.

For integers, it is preferable to use the static method valueOf () that is more readable:

BigDecimal.valueOf (40)

There are three methods to create a static BigDecimal value 1 or 0 or 10.

  • BigDecimal.ONE
  • BigDecimal.ZERO
  • BigDecimal.TEN

In short, it is recommended that:

  • For a fee, rate or a percentage, the constructor with a String parameter: BigDecimal = new BigDecimal stringApproche ("7273.27");
  • For units, the static method valueOf: BigDecimal.valueOf ( 40) For
  • remarkable values 0, 1 and 10: use static methods: BigDecimal.ZERO, and BigDecimal.ONE BigDecimal.TEN

Addition and subtraction with BigDecimal.

Addition and subtraction do not feature in Apart from the requirement to use a method:

  • add subtract

It will for example

BigDecimal value = new BigDecimal ("70.36")
/ / resAddition = value + 1 = valeur.add resAddition
BigDecimal (BigDecimal.ONE)
/ / = value -10 resSoustraction
resSoustraction BigDecimal = valeur.subtract (BigDecimal.TEN)

Multiplication and Division BigDecimal

Multiplication on the same principle that addition and subtraction using the method: multiply.

BigDecimal = new BigDecimal pricePerShare ("70.36");
/ / coutTotal pricePerShare = * 3 = pricePerShare.multiply coutTotal
BigDecimal (BigDecimal.valueOf (3));


For the division is more complicated because it must indicate:

  1. the number by which we divide
  2. but especially the number of digits after the decimal point that we wish to retain the result (a division does not always just fall)
  3. and finally the mechanism rounding: we usually use BigDecimal.ROUND_HALF_UP

For example, the number of shares purchased:

BigDecimal = new BigDecimal pricePerShare ("70.36");
purchaseAmount = BigDecimal.valueOf BigDecimal (200);
/ / = nbPart purchaseAmount / pricePerShare
BigDecimal nbPart = purchaseAmount . divide (pricePerShare, 4, BigDecimal.ROUND_HALF_UP)

There are two methods to simplify multiplication and division by multiples of 10:

  • movePointLeft (2) we move the decimal 2 to the left of which corresponds to a division 100.
  • movePointRight (1) is moved from one point to the right which corresponds to a multiplication by 10.

These two methods are particularly useful when calculating rates or percentages.

BigDecimal total = BigDecimal.valueOf (950);
BigDecimal BigDecimal.valueOf Percentage = (20);
/ / We want 20% of 950
/ / amount = (total * percentage) / 100 = total amount
BigDecimal . multiply (percentage). movePointLeft (2);

comparison method should be promoted: compareTo that ignores the number of digits after the decimal point. compareTo considers that 15.2 and 15 200 are identical. This is not the case with equals ().

The method compareTo returns an integer and not boolean:

  • 0 if the value is identical
  • 1 if the value is greater than the parameter
  • -1 if the value is less than the parameter

In through the use of JUnit we recommend:

assertEquals ("Comparison", 0, doubleApproche.compareTo (stringApproche));

instead of:

assertEquals ("Comparing imprecise "doubleApproche, stringApproche)

Indeed in some cases (small gap): the first show is a difference, while the second will show a tie.

Display

To view a BigDecimal, there are two methods:

  • plainString
  • toString

We recommend using a third solution: the use of formatting with DecimalFormat. this mechanism to force the representation of BigDecimal following a defined format.

The following example is significant: we have deliberately used the double manufacturer to show the difference.

BigDecimal = new BigDecimal doubleApproche (7273.27);

System.out.println ("7273.27 toPlainString:" + doubleApproche.toPlainString ());
System . out.println ("7273.27 toString:" + doubleApproche.toString ());

DecimalFormat DecimalFormat = new DecimalFormat ("##,###,###,## 0.00 ");
System.out. println ("7273.27 DecimalFormat:" + decimalFormat.format (doubleApproche));

Conclusion

Using BigDecimal is a little heavier than double. But there are a set of methods to streamline work and especially the assurance of not having a problem rounding at the end.

This forces us to disambiguate the choice of rounding early: This avoids disappointment with the business teams during the phases of recipe. The business teams are fully aware of these rules, they they are so natural that they forget to specify them. Using BigDecimal forces us to determine from the beginning of the program what to do.

Monday, May 25, 2009

Numéro Série Néro 3.1

AppStore: Analysis of a successful

This post is part of a broader debate on the issues revolutionary iPhone. It focuses on the AppStore whose success goes beyond numbers provided by Apple: 35 000 applications and a billion downloads of May 2009 (press release from Apple: http://www.apple.com / fr/pr/library/2009/04/24appstore.html? sr = Hotnews ). This approach

market place has been taken from Google, Nokia, RIM and Microsoft (for BlackBerry). The concept seems to be sufficiently novel and interesting to be taken by the competition.

Since April 2009, advertisements for the iPhone focuses exclusively on the applications available on AppStore rather than on the iPhone itself. It is a sign of the importance of the ecosystem iPhone in the purchase decision. And who better symbolizes the AppStore this ecosystem. The AppStore

Beginning with the AppStore soon present especially for readers who are not familiar with the iPhone. The AppStore is a great market applications for iPhone and iPod Touch. It is priced applications and free applications.

The AppStore is a department of the famous iTunes Store (the world leader in music sales). It is available from the iTunes software: To navigate through the AppStore, so it is not necessary own an iPhone, just use iTunes. There is a version of the iPhone AppStore, it is possible to view and download applications directly from the iPhone.

The AppStore has different grading applications: in general there are two separate classifications: one for free applications and one for paid applications. Free applications are not hidden or buried at the bottom of the site they have the same visibility as paid applications.

Extent of success of the AppStore

Apple Announces 35 000 applications worldwide, 10,000 available for France. The figure speaks for itself and it is hard not to find the application you need.

Of the 10 000 applications, we will find in the News section by an application for this newspaper and the entire world press. It will thus find an application to:

  • reading World
  • reading the New York Times
  • reading El Pais (Spain)

And many more. Note that this is three different applications.

iPhone can also be used as book reader: it is possible to buy books in electronic format: in this case, a book is an application.

These examples are given to show the actual number of applications is in practice less than 10 000. Nevertheless, it remains very important and probably beyond what is available on competing platforms.

Apple announces one billion downloads: we can estimate the number of iPhones sold around 20 million. It would therefore be on average 50 per iPhone download. That seems excessive. I think Apple has a download for updating. For example, readers of The New York Times that I use had to be updated a dozen times: Apple probably has 10 downloads.

That said, all applications have few versions and what is more: a user is not obliged to make the update. One the other, I think a user has loaded an average of about twenty different applications. This figure is very important if we consider that this is an average for a consumer product composed mainly of non computer.

At the time I loaded on my Palm 4 or 5 applications in 4 years of use. On the iPhone and through the AppStore, an average user has downloaded a twenty applications in 9 months of use.

Such an increase (factor 4) on as wide a population can be the fact that a major change, revolutionary. It is this or these changes we will identify. My Applications

Before going further in the analysis, I will list the 29 applications I installed on my iPhone it will illustrate the different types of applications.

  • news sites:
    • ElPais.com: application of the newspaper El Pais (Spain) The
    • Monde.fr: application of the World. It allows offline reading of sections of the site. Attention items are shorter than those of the printed newspaper.
    • NYTimes: Applying the New York Times (USA). The papers seem full (They are much longer than those of the World) but the offline mode does not.
    • Sports.fr: A sports newspaper with a live mode that tracks sporting events (such as a day of championship soccer) live.
  • Games Crash Bandicoot Nitro
    • : A kind of Mario Kart that uses the accelerometer. For me the level of Mario Kart for Nintendo DS with the exception of multi-player mode is not available.
    • Hanoi: The puzzle towers of Hanoi
    • iChess (Free): a chess
    • Mastermind: the game of MasterMind
    • TouchMines: a version of Minesweeper. A bit difficult to play because the boxes are too small. Virtual Pool
    • Lite: a very good game of pool which makes it very well the feelings of real billiards.
  • productivity applications
    • SimpleMind Xpress: An application of brainstorming
    • Evernote: a great application for taking notes which are spoken, written or also photo taken with the iPhone. There is also a for Windows and a Firefox plug-in to rate music by website.
  • references and dictionaries
    • dictionary Littré: a very old version and just past that the dictionary Littré I use words to explain to children
    • PagesJaunes: this application extends the Web site by making available the use of localization.
    • Wapedia - Wiki Mobile: A very friendly version of Wikipedia for the iPhone.
    • 160 000 Recipes: A recipe site (in English)
  • Help moving
    • Wikango: an excellent warning radar
    • PanameTraffic: To view the traffic on the Paris region, become a little less useful since the traffic is also available directly on the implementation plan (Google Map)
    • GoVelib: To know the Velib stations around you and their availability cycling.
    • Locly: to understand a few types of businesses or services (such as ATM card blue) around you.
  • Entertainment
    • Liveradio Orange can listen to radio stations over the Internet.
    • First: The latest film critics with sessions near you.
    • Stanza: a book reader for iPhone. The application allows the downloading of large quantities of books in English or French (all old).
  • Utilities
    • Orange spot'finder: Enables you to find the Hot Spot WiFi around you.
    • Speedtest: Measures the speed of your Internet connection. One application which has in August / September 2009 to highlight the clamping of the Orange 3G.
    • 9 - Toolbox (Free Event): a series of small utility that runs from the unit converter spirit level
  • Social Networks
    • LinkedIn: the application to connect to professional social networking site LinkedIn
  • The gaming applications
    • Lightsaber Unleashed: A Star Wars lightsaber. Ideal to impress young children.
  • Applications advertising
    • Angoulême 2009: Application created for the festival of Angoulême BD who can flip a series of comics.

From this list of applications only Crash Bandicoot Nitro Kart 3D pays off: the rate of 5 € price is very competitive with a Nintendo DS at 35 €.

Benefits

The concept AppStore AppStore may be regarded as deriving from the iTunes Store: a marketplace for applications. It enjoys the same advantages:

  • simplifies the search: it is not necessary to search multiple stores or on different sites which application is best or what application is available. Just go to the AppStore and see if there is a new application that might interest us.

But the AppStore adds a characteristic application markets:

  • confidence in applications: applications are "validated" by Apple. Even if you do not know what it really implies, it is certain that this excluded the virus.
  • Creating a market place has had another benefit for users: the competition between producers of applications to cause a significant drop in prices: the majority of game publishers have launched their games at prices close to 17 $ few days later regained the same games around $ 7. So, there are many applications at prices significantly lower on the iPhone than on competing platforms. In my list Crash Bandicoot Nitro Kart is a great example: for 5 € was a game that would be € 35 for Nintendo DS.

These three points certainly explain the one billion downloads in less than a year.

The AppStore as a social bond

confidence and simplicity to grow downloads "fun" I mean, downloading of applications (often free) just to see what they do. It does not necessarily seek the utility side but the "fun": a mixture of surprise and "fun", see a lag. These are applications that we will show that will serve to initiate a discussion: it serves to create a social bond between two people is sometimes used as a newspaper article, an event where more systematically a sporting event.

Among these applications we find the emblematic Shazam that can recognize a song and that is regularly used in Apple advertising. In my list, you will find Light Saber that can bind the conversation with children. Some small games are also ideal for little short they are simple and fun.

In the list of applications you will find a box silly moo (moo fact that when the returns), a whoopee cushion, aquariums ... These downloads

"fun" is a real phenomenon among iPhone users and can easily account for a third of downloads. This phenomenon is even stronger than with the iPhone version of the AppStore, the viewer can move quickly conquered download the new application immediately and with confidence because it hosted on a site controlled by Apple.

This type of behavior would not be as important (a half-dozen download per person on average) without the feeling of confidence inspired by the AppStore: the stroke of genius from Apple. This is a revolution in user behavior even if I should limit its usefulness seems to me.

Beyond this playfulness, the choice of a lot of applications must also be some affirmation of identity of the owner of the iPhone: the choice of a newspaper is not neutral for example. We find a modern equivalent of family libraries for displaying through the selection of books placed prominently on the shelves social status. It is applications like books: not because it is present on an iPhone it is used. Conclusion

The AppStore is a breakthrough offering iPhone behavioral changes that resulted. This change was possible only because users felt confident about the existence of a market place under the control of the manufacturer.

What is revolutionary is the attention and importance that is Apple's ecosystem, many analysts have explained the defeat of MacOS on Windows by the little attention that Apple developers had to wear while they have always been pampered by Microsoft. The lesson seems to have been chosen by Steve Jobs and the thousands of expected new API with the 3.0 firmware of the iPhone should not deny this change.

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.