Friday, December 28, 2007

Camila Rodriguez Teanny

JavaBeans API to copy

recent times often encounter the problem of having to create copies JavaBean'a. While written for the Java API for thousands, however, this simple action is still no ideal solution.

Let me explain briefly what I mean. Above all, such an API should provide the following functionality:

  • deeper into the copy (so-called deep copy) - Copy the reference is not an option because it is not then really the copy
  • not copy n times the same reference - if the original building there are many references to an object, then the copy should also be many references to the copied object
  • deal with the cycles - in the event of a cycle should not throw exceptions
  • supplied ClassLoader used to load classes - so that you can provide the modified class

the web I found some solutions. Among other well-known Commons Beanutils . Unfortunately, it does not meet single requirement. The second library, which I fell into the hands was Sojo. API is under development but already has many features. Supports copying into the depths and can cope with cycles. Do not copy a previously copied references. Unfortunately I have not found a way to provide your own ClassLoadera.

Due to the lack of a dream library started to look for alternatives. The first technique that was used the built-in serialization. Unfortunately, this method does not allow to provide their own ClassLoadera (ClassLoader is used for calling the method deserialize) and requires that each class implemented the Serializable interface.

Another solution that I tested was the use of encoders <-> XML JavaBean provided with the JRE (Class XMLEncoder, XMLDecoder). This technique is by far the slowest, but at first glance it seemed that has all the features that I require from this API. Unfortunately, although providing your own ClassLoader'a it is not used to load all the necessary classes.

After several days of trying various technologies found it sooner as he will implement this functionality. And in this way in 2 days I wrote a simple API to copy beanów with all functionalities. API BeanCopier bears the working name for the time being is available for download on Maven 2 repository at: http://eggframework.org/maven2 .

To use the API in its own project, Maven 2 should be added to the pom.xml:

  \u0026lt;  project  >   \u0026lt;  dependencies  >   \u0026lt;    dependency>   \u0026lt;    groupId>   com.jacekolszak  &lt;/    groupId    >  
&lt; artifactId > beancopier &lt;/ artifactId >
&lt; version > 0.9 &lt;/ version >
&lt;/ dependency >
&lt;/ dependencies >
&lt; repositories >
&lt; repository >
&lt; id > Egg Framework &lt;/ id >
&lt; url > http://eggframework.org/maven2 &lt;/ url >
&lt;/ repository >
&lt;/ repositories >
&lt;/ project >


Sposób Use BeanCopier:

 BeanCopier beanCopier = new BeanCopierImpl () ;  copy = beanCopier.copy (original, classLoader) ;  

soon throw in the CVS source. As long as they are available in the ravine beancopier-0.9-sources.jar the second repository Maven

UPDATE: Sources are available on the Bazaar repository at: http://bazaar.launchpad.net/ ~ jacekolszak / beancopier / trunk . Simply issue the command: bzr branch
http://bazaar.launchpad.net/ ~ jacekolszak / beancopier / trunk
to download the latest sources.

Monday, December 17, 2007

Blood Pressure Over 100

Fluent Interface in Egg Framework 2.0

One of the most exciting features introduced to Egg Framework 2.0 is a Fluent Interface - API, you can use to create readable code web applications in Java - to my surprise looking very similar to HTML.

Fluent Interface is a concept introduced by Martin Fowler and Eric Evans. They named this term to create a style of programming interfaces. More can be read on a blog Martin Fowler.

Here is an example web page created using the Fluent Interface implemented in Egg Framework 2.0 :

   package     org    .    eggframework2    .    view    .    examples    .    xhtml    ;  

import static org . eggframework2 . view . elements . xhtml . ext . FluentInterfaceMethods . * ;

import org . eggframework2 . view . elements . IElement ;
import org . eggframework2 . view . elements . xhtml . tags . Html ;

public class FluentInterfaceUsageExample extends Html {

public FluentInterfaceUsageExample ( ) {
IElement body = //
body ( //
p ( "Hello World" ) , //
a ( "Egg Framework Page" , href ( "http://eggframework.org" ) ) , //
form ( action ( "/action.do" ) , method ( "post" ) , //
input ( type ( "text" ) , name ( "Login" ) ) , br ( ) , //
input ( type ( "password" ) , name ( "Password" ) ) , br ( ) , //
input ( type ( "submit" ) , value ( "Please log me in" ) ) //
) , //
table ( //
tr ( //
td ( "Cell 1" ) , td ( "Cell 2" ) , td ( "Cell 3" ) //
) , //
tr ( //
td ( "Cell 1" ) , td ( "Cell 2" ) , td ( "Cell 3" ) //
) //
) ) ;

add ( body ) ;
}

public static void main ( String [ ] args ) { system. out. println ( new FluentInterfaceUsageExample ( ) ) ; }}

As you can see Java code is very clear and similar to the resulting HTML code. All thanks to the use of static methods and static imports. By importing all the classes FluentInterfaceMethods methods you can use them on your page as if they were part of it. We do not need so precede the name of the method name of the class in which it is defined. This makes code is much more concise.

FluentInterfaceMethods class methods in addition to creating instances of the elements (tags) HTML has a method of forming attributes such as type , name, id . This allows you to create a one line item and set its attributes.

If you are frequently placing the source code (Pretty Print) then you must be prepared for the fact that most of the IDE will work out the code that page with one line (because all the content by creating a nested method calls). It certainly does not help to increase readability of the code, just the opposite - it significantly worse. To guard against this situation, use the comments ("//") in places where the IDE is to break the line. Thanks to them, even after the laying operation code, the code will be nicely presented.

Fluent Interface in Egg Framework is a way to increase the readability of the code is created. It is a kind of overlay, and uses the existing API. After several / several minutes of work you should get used to this "strange style of programming." Depends on you whether you used it or not - in many cases may prove to be better, but there may be situations where the creation of content pages "in the usual way" would be easier and faster.

Tuesday, February 20, 2007

Install Gta On More Than One Pc




changes of the Radio Regulations already soon in Geneva on Monday started in a two-week meeting of the CPM 07-2 (Preapartory Conference Meeting). 825 delegates from around 200 countries and international organizations is preparing more than 500-page report, which will be the subject of autumn obżad World Telecommunications Conference WRC-07, which makes changes to the Radio Regulations.
first two days is how far organizational matters, the appointment of working groups, assigning hundreds of documents - the contributions and proposals for changes to the report - in boxes still far more green cards (administrative documents) than yellow (proposed amendments to the report).


The topics include extend the frequency ranges for the family of IMT-2000 mobile WiMAX in 2,5-2,69, transmitters stratospheric balloons HAPS, upraktycznienie procedures for the registration of the satellites and many others :-)



More information soon.



Please be informed number of elected members of the delegation:



USA: 92

France: 52

Japan: 41

Russia: 37

China: 35

United Kingdom: 31

South Korea: 27

Canada: 27

Germany: 22

Belarus: 7

Ukraine: 7

Czechs: 6

Slovaks: 1

is also 25 representatives of the largest telecommunications companies.

The Polish delegation is a 4 seater.





more

Wednesday, January 31, 2007

Tips On Pool Auditions



An important amendment to the Telecommunications Act - calls for tenders, the frequency
Polish President signed yesterday, 30 January 2006, the Law of 12 January 2007 amending the Law - Telecommunications Law. This Act shall enter into force after 14 days from its publication in the Official Gazette.

amendment regulates in a way more accurate than the existing provisions of tenders for frequency resources, opening up wider possibilities than before secondary trading of frequencies owned by the same operators and enhance the supervisory powers of the President of UKE, allowing him to change or even picking up the operators of spectrum used in an inefficient manner.

Since frequency spectrum is important for the development of information society and reach new technology (including interentu) on land, on which is not worth the effort to build a cable network, and simultaneously a very limited change is very positive.

And the effects of which will lead in practice to wait.

Thursday, January 25, 2007

Purpose Of Biology Lab



MON sent today, 7 frequency channels needed to build a DVB-T network in Poland has signed an agreement
Minister Radoslaw Sikorski, the President and Mrs. Anna Streżyńska
was with great fanfare at the premises of Defense
details here http:// www.mon.gov.pl/artykul_wiecej.php?idartykul=2609

occasion came to the first personal meeting unless you and the President of UKE Madam Chairman welcomed Mr
NBC in August at the very beginning of the press conference, three photographers, who exactly they came to this celebration will probably the only in Poland, these two pictures of you together is
envy :-)

Tuesday, January 23, 2007

Mbd In Bearded Dragons Can The Paralysis Reverse



promise to facilitate the access to the frequency?

currently takes place in Geneva at the ITU organized an international workshop on the use of market mechanisms in spectrum management process.
encourage you to familiarize yourself with presentations available at: http://www.itu.int/osg/spu/stn/spectrum/agenda.html

Looks like, thanks to the recent amendment to the law on telecommunications, waiting to be signed by the President, be at the forefront of countries that have adopted the Secondary distribution of frequencies.

text amendment ultimately adopted by the Parliament at this address http://orka.sejm.gov.pl/opinie5.nsf/nazwa/1016_u/ $ file/1016_u.pdf

AMENDMENT also greatly improved regulations for the tender , allowing m.in to perform typical auction, where only the price will determine who receives rezrewacje frequency.
interesting in this context were the voices of the countries where spectrum auctions are already performed for several years (eg UK), which point to the shortcomings of such a system distribution, and calling for the creation model inhabited - where not only price, but the degree of implementation of public goals, including the social constitute a selection criterion.

are interesting models which do not count the price of what someone can pay at the start (promotes the existing telecom-rich), but what percentage of revenues will be indulged in the activity. It's getting the right amount offered and allow new operators to enter the market.

More thoughts soon, as I myself is all sorted :-)

Were To Get The Device On Poptropica



blog again after a break is reactivated

because of professional duties, this time more insider Than ever before ;-)

begin this note to encourage tracking new blog - among the members of generation Web 2.0, elected, each separately, by The Time Person of the Year 2006, Ms. joined by President of the Office of Communications - Anna Streżyńska
can track the blog at the following address http://annastrezynska . blog.onet.pl /