Ads 468x60px

freak2code is the blog about latest geek news,software reviews ,trends in technology and more informative stuff......

Sunday, 19 August 2012

65 Beautiful Mosques Around The World


65 Beautiful Mosques Around The World


Mosques (or masjids for Arabic) are places of worship for followers of Islam. These places of worship for muslims around the world have existed for more than a millennia. With the spread of Islam across the world for a thousand years, distinct styles have inevitably evolved from the earliest masjids. In the past century, fusions in architectural styles from different cultures have even resulted from the effects of globalization.
With today’s rapid modernization of the world, we can even see more advanced forms of architectures in the latest masjids. Nevertheless, the beauty and reverence for such sacred places of worship remains in these structures, all thanks to the rich history that these masjids possess.
What better time than to appreciate the beauty of these Islamic architectures than the month ofRamadan? Here’s 65 awe-inspiring mosques from various countries around the world that’ll leave you breathless!
Recommended Reading: 45 Awe-Inspiring Landmarks Around The World
Siddiqa Fatima Zahra Mosque (Kuwait) (Image Credit: Matthew Jacob)

Emir Abdelkader Mosque (Constantine, Algeria) (Image Credit: Beautiful Mosques)

Blue Mosque (Yerevan, Armernia) (Image Credit: Beautiful Mosques)

Abu Derwish Mosque (Amman, Jordan) (Image Credit: Beautiful Mosques)

Akhmad Kadyrov Mosque (Grozny, Chechnya) (Image Credit: Beautiful Mosques)

Mecca Masjid (Hyderabad, India) (Image Credit: Beautiful Mosques)

Masjid Raya Mosque (Tanjong Pinang, Indonesia) (Image Credit: Beautiful Mosques)

Great Mosque of Xining (Xining, China) (Image Credit: Beautiful Mosques)

Tokyo Mosque (Tokyo, Japan) (Image Credit: Beautiful Mosques)

Lead Mosque (Shkoder, Albania) (Image Credit: Beautiful Mosques)

Hui Mosque in Ningxia (Ningxia, China) (Image Credit: Islamic Arts and Architecture)

Shrine of Hazrat Ali (Mazar-i-Sharif, Afghanistan) (Image Credit: Famous Mosque)

Saint Petersburg Mosque (St. Petersburg, Russia) (Image Credit: Zaratra)

Mosque-Madrassa of Sultan Hassan (Cairo, Egypt) (Image Credit: Ernie Reyes)

Sultan Qaboos Grand Mosque (Muscat, Oman) (Image Credit: Jerome Ryan)

Al Nida Mosque (Baghdad, Iraq) (Image Credit: Mihoub Fares)

Sunshine Mosque (Victoria, Australia) (Image Credit: William Bullimore)

Sultan Omar Ali Saifuddin Mosque (Bandar Seri Begawan, Brunei) (Image Credit: Tylerdurden1)

Sultan Omar Ali Saifuddin Mosque 2 (Bandar Seri Begawan, Brunei) (Image Credit:NeilsPhotography)

Baitun Nur (Alberta, Canada) (Image Credit: Engr. Mazhar-ul-Haq Khan)

Sheikh Zayed Grand Mosque (Abu Dhabi, UAE) (Image Credit: Dennis Teoh)

Sheikh Zayed Grand Mosque 2 (Abu Dhabi, UAE) (Image Credit: Best in Travel)

Sheikh Zayed Grand Mosque 3 (Abu Dhabi, UAE) (Image Credit: Wikipedia)

Taj Mahal Mosque (Agra, India) (Image Credit: Wikipedia)

Qolsharif Mosque (Kazan, Russia) (Image Credit: Wikipedia)

Imam Reza Shrine (Mashhad, Iran) (Image Credit: Meysam110)

Badshahi Mosque (Lahore, Pakistan) (Image Credit: Wikipedia)

Green Lane Masjid (Birhingham, United Kingdom) (Image Credit: Wikipedia)

Wazir Khan Mosque (Lahore, Pakistan) (Image Credit: Wikipedia)

Sabancı Merkez Camii (Adana, Turkey) (Image Credit: Wikipedia)

Al-Saleh Mosque (Sana’a, Yemen) (Image Credit: Himo)

Jumeirah Grand Mosque (Dubai, UAE) (Image Credit: Elvis Payne)

The Mosque of Muhammad Ali Pasha (Cairo, Egypt) (Image Credit: Brian Connor)

Kowloon Masjid and Islamic Centre (Hong Kong, China) (Image Credit: ZN Web Studio)

Al-Azhar Mosque (Cairo, Egypt) (Image Credit: Jan Matysek)

Grande Mosquee de Paris (Paris, France) (Image Credit: Fredcan)

Great Mosque of Hohhot (Inner Mongolia, China) (Image Credit: Chaloos)

Imam Mosque (Isfahan, Iran) (Image Credit: HybridLava)

Nur-Astana Mosque (Astana, Kazakhstan) (Image Credit: Frost-uw)

Jamia Mosque (Nairobi, Kenya) (Image Credit: Laird Scott)

Crystal Mosque (Terengganu, Malaysia) (Image Credit: Azam Hashim)

Crystal Mosque 2 (Terengganu, Malaysia) (Image Credit: Mohammad Azmi)

Masjid Bahagian Kuching (Sarawak, Malaysia) (Image Credit: Bingregory)

Putra Mosque (Putrajaya, Malaysia) (Image Credit: Ming Chan)

Putrajaya Mosque (Kuala Lumpur, Malaysia) (Image Credit: Jim Boud)

Grand Mosque (Mecca, Saudi Arabia) (Image Credit: Hossam All Line)

Grand Mosque 2 (Mecca, Saudi Arabia) (Image Credit: Sharif Afridi)

Jama Masjid (Delhi, India) (Image Credit: Sharif Afridi)

Hassan II Mosque (Casablanca, Morocco) (Image Credit: Rosino)

Abuja National Mosque (Abuja, Nigeria) (Image Credit: Irene Becker)

Sultan Haji Hassanal Bolkiah Masjid (Cotabato City, Philippines) (Image Credit: Eazy Traveler)

Sultan Mosque (Singapore) (Image Credit: Judhi Prasetyo)

Great Mosque of Djenne (Mali Djenne, Mali) (Image Credit: El-Len)

Faisal Mosque (Islamabad, Pakistan) (Image Credit: Ian Cowe)

Jami Ul-Alfar Mosque (Colombo, Sri Lanka) (Image Credit: Rushika Silva)

Another 10 More..

Ahmadiyya Anjuman Isha’at Islam Mosque (Paramaribo, Suriname) (Image Credit: Malakospapakos)

Al-Aqsa Mosque (Old City, Jerusalem) (Image Credit: Malakospapakos)

Great Mosque of Damascus (Damascus, Syria) (Image Credi: Bashar Shglila)

Omayyed Mosque (Damascus, Syria) (Image Credit: Hussein Alazaat)

Sultan Ahmed Mosque (Istanbul, Turkey) (Image Credit: Discodoener)

Kocatepe Mosque (Ankara, Turkey) (Image Credit: Ahmed Wisam)

Seoul Central Mosque (Seoul, South Korea) (Image Credit: Izamree)

Mosque of the Prophet (Medina, Saudi Arabia) (Image Credit: Mubarak ALThani)

Mosque of the Prophet 2 (Medina, Saudi Arabia) (Image Credit: Azozphotography)

Al Fateh Grand Mosque (Manama, Bahrain) (image Credit: Roger Solas)

rtechinsane,icodesource,SEO,SEO Tips,SEO Backlinks,SEO content,SEO tricks,SEO Engine,codes,gadgets,iphones,ipad,4G phones,geeks,reviews,database,DBMS,

  1. warehouse,datamining,datawarehouse

Saturday, 18 August 2012

The way to Burn Movies on Computer to be able to Blu-ray Disc?


The way to Burn Movies on Computer to be able to Blu-ray Disc?

Blu-ray disc provides fantastic storage capacity which can be up to 50GB. It really is convenient and perfect for saving superfluous video files. Utilizing proper gadgets and also computer software, burning Blu-ray disc just isn't more challenging than burning a typical DVD.
In order to burn videos to Blu-ray disc, you might need a Blu-ray drive which is capable of reading and also burning Blu-ray discs. Normal DVD drive cannot handle Blu-ray disc. Furthermore, you will need a burning computer software as an assistant. Generally speaking, this type of burning tool is straightforward to steer. In the event you don't learn how to operate it, take under guide for reference.

1. Add videos to video to Blu ray Burner
Launch Blu-ray creator, click the "Add"button to import video clips to the program; it is possible to preview it around the built-in player simply by twice clicking it.
2. Edit video files (Optional)
It is possible to edit the video files simply by pressing "Edit". You can find four options for one to edit the videos.
3. Output menu customization
Click on the "Burn to DVD & Blu-ray" button to attend the panel to choose menu templates and also do customization. To your preference, you can find numerous food selection web templates available: Standard, Business, Education, Holiday, Nature, Others. Once you unfold each and every food selection template, you'll get sub templates for options. In order to customize menu, it is possible to simply click "Customize Menu".
4. More settings with the output
Select "Next" option then it's going to turn to the particular panel inside the following: Do some selections In "Volume Label", "Burn to", "Options", "Video Settings", "Disc Type", "Video Quality" and "Required Disc Space".

ADATA DashDrive HV610 USB 3.0 External Hard Drive could be the solution to your storage puzzle


ADATA DashDrive HV610 USB 3.0 External Hard Drive could be the solution to your storage puzzle

Most portable storage devices like external hard drives are not the best lookers around when it comes to design, but ADATA has a statement to make with their latest offering, the ADATA DashDrive HV610 USB 3.0 External Hard Drive. I guess that taking a glance at it, you would surely agree that this is a fashionable puzzle piece design that comes with its very own slide-out smart cover that adds to the overall convenience, considering how this is a novel method of storing the transmission cable when it is not in use.
As for data transfer speeds, you need not fret – especially when the ADATA DashDrive HV610 USB 3.0 External Hard Drive will play nice with the SuperSpeed USB 3.0 interface that is all the rage these days, sporting a theoretical data transfer speed of up to 10 times that of USB 2.0, making it a snap for you to send those Full HD movies over to the ADATA DashDrive HV610 USB 3.0 External Hard Drive in the blink of an eye, when previously you could even cook up a meal while you wait.
The ADATA DashDrive HV610 USB 3.0 External Hard Drive will feature a body that comes in a couple of attractive monochrome patterns, where each of them will feature interlocking shiny and matte puzzle piece lines. The HV610 itself has a cool ice-blue cover that can be removed easily to hold the USB cable when not in use, delivering style and practicality in a single package.
Depending on your needs, you will be able to choose from 500GB and 1TB capacities for the ADATA DashDrive HV610 USB 3.0 External Hard Drive, which will retail for $79.99 and $99.99, respectively. You can opt for either cool black or twinkling white colors, and have the added bonus of downloading Norton Internet Security 2012 anti-virus software (60 day trial version) for free, not to mention being on the receiving end of a 3 year warranty service for added peace of mind.

App (and Device) to Keep You Healthy


App (and Device) to Keep You Healthy

Plenty of iPhone apps exist to help you stay healthy. You have food tracking, exercise tracking, heart rate monitoring. The list goes on and on. We can’t seem to get enough apps to help us live healthy lives. One more to add to your list for later this year is Lapka Personal Environment Monitor. Lapka consists of 4 small devices that connect to your iPhone. Once the Lapka app is downloaded, attach a device and measure:
  • Organicity of food and water: Includes a probe to look for significant nitrates, caused by residue of synthetic fertilizer, indication of a non organic source.
  • Humidity: Temperature and relative humidity to exist in the optimum climate.
  • Radiation: Each particle is counted to help you understand how it may impact you.
  • EMF/Electromagnetic field: Electronics, telecommunication devices and power lines can create adverse effects.
Lapka is more than just a measuring device however. It analyzes data received with both your personal history and with average target values of each environment. You can also collect snapshots of your data through the day to create your own comfort diary. Then Lapka literally helps you optimize your surroundings to live a better healthier life.
After a very successful Kickstarter campaign (raising over $170,000 on an ask of $25,000) Lapka is in production. They anticipate a late 2012 launch with a $220 price point. Sign up for email updates atmylapka.com to stay in the loop.
Think about it. Food tracking apps are good, but you pretty much know that eating the French Fries is not good for you. And apps can check some of your vitals, you can too though. But there are many unknowns in this world that impact our health and that, without a scientist in tow, we can never measure. Lapka is coming, to help us learn more about our environment, stay safe and stay comfortable.

Samsung Galaxy Note 10.1 arrives in the US at long last


Samsung Galaxy Note 10.1 arrives in the US at long last

When Samsung first released the Samsung Galaxy Note, it proved to be quite the sleeper hit. After all, who would have thought that a smartphone device with an unerringly huge display, would actually also double up as a pseudo tablet of sorts? Of course, this would have meant going to the tailors to make sure that your pants pockets are enlarged to accommodate the more generous size of the “phablet”, helping coin a new word in the process. Well, it had to happen – there is a new Galaxy Note in town, and this is the Samsung Galaxy Note 10.1.
The Samsung Galaxy Note 10.1 would definitely be the latest addition to the Galaxy Note family of devices, where it intends to continue from where the original Galaxy Note left off. With the Samsung Galaxy Note 10.1, you will be able to enjoy the functionality and precision of a pen and paper through the merging of the S Pen alongside a 10.1-inch display that is definitely generous compared to its smaller brethren.
Apart from the stunning hardware, Samsung has not forgotten about the end users and consumers, which is why they have thrown into the mix Adobe’s premium creative application, Photoshop Touch that has been specially optimized for Samsung’s S Pen in order to deliver unprecedented precision and control. Not only that, the Samsung Galaxy Note 10.1 will also introduce the game changing Multiscreen feature that enables you to operate a couple of different apps side-by-side, simultaneously, on the same screen.
Underneath the hood lies a 1.4GHz quad-core processor and 2GB of RAM which should be more than sufficient to get it going, allowing the Samsung Galaxy Note 10.1 to handle all that you can throw at it without missing a beat. Another thing to take note of the Samsung Galaxy Note 10.1 would be its an advanced S Pen feature that has 1,024 levels of sensitivity, making it ideal for natural and intuitive content creation. You can choose from white or dark gray colors, where it will come in 16GB or 32GB memory configurations, retailing for $499 or $549, respectively.

JAYS announces a-JAYS One+ headphones that comes in white


JAYS announces a-JAYS One+ headphones that comes in white

 
 
There is just something about Swedish chic that is very appealing to the masses – just take a look at the kinds of furniture that IKEA rolls out, sporting clean lines and functionality without costing a bomb in the process. Well, take Volvo as another example – many a time touted to be the world’s safest car, Volvo has certainly sexed up its corporate image over the years, leaving us with a vehicle that is definitely worth owning – if you can afford it, of course.
Well, today we have the a-JAYS One+ headphones that was announced by JAYS, where it will come in white. This pair of headphones is based on the award winning a-JAYS series high quality sound platform, where it will also boast of an 8.6mm dynamic speaker, in addition to tangle-free flat cables, a remote control with a built-in microphone and an L-shaped connector. In the package itself, the remote control and microphone will enable you to pick up and hang up calls, while you play or pause your music, in addition to being compatible with your local music library, Skype and iChat.
JAYS has also specially developed a complimentary JAYS Headset Control App for Android that enables you to discover additional features for yourself, transforming your a-JAYS One+ into a fully customized multi-feature control. If you own an Android-powered device and have just enough budget to blow on a pair of above average earphones, then the a-JAYS One+ would be it as it was specially optimized for Android. Of course, it will also works just fine with Blackberry, Windows Mobile devices like the Nokia Lumia, in addition to the slew of iOS devices from Apple.
It is nice to see how the white model of the a-JAYS One+ headphones will go down nicely with the recent release of the Samsung Galaxy S3. The asking price of the JAYS a-JAYS One+ headphones is not one that will burden you, considering it had been slapped with a $59.99 price point.
Rune Torbjörnsen, CEO Jays AB, said, “We are happy to launch an alternative color to the award winning a-JAYS One+, a headset that has proven to be the first choice for our style-conscious fans, experiencing the concept of JAYS Mobile Music on a global scale with its unrivaled sound quality and simplicity. a-JAYS One+ is delivering audio quality that is far superior to that of the standard earbuds packaged with MP3 players or phones, while also giving completely customized control with our free, highly ranked and leading, JAYS Headset Control app. a-JAYS One+ is yet another strong expression of the passion, innovation and love for music that we want to share, with strong and authentic Swedish products in our own design.”

rtechinsane
,icodesource,SEO,SEO Tips,SEO Backlinks,SEO content,SEO tricks,SEO Engine,codes,gadgets,iphones,ipad,4G phones,geeks,reviews,database,DBMS,
warehouse,datamining,datawarehouse

NetBeans 7.2: Refactoring Parameterized Constructor As Builder


NetBeans 7.2: Refactoring Parameterized Constructor As Builder

Shortly after the Second Edition of Josh Bloch's Effective Java was released, I borrowed a colleague's copy to browse it and consider purchasing a copy of my own despite already owning a copy of the first edition. It did not take me long to realize that the Second Edition was worth purchasing. In particular, the usefulness of the first new item in the Second Edition (Item #2 "Consider a builder when faced with many constructor parameters") struck me. This item addressed many issues I had run into during my Java development in a nice fashion. In this post, I look at the approach described in that chapter and look at how NetBeans 7.2 provides refactoring support for this approach.
As outlined in Item #2 of the Second Edition of Effective Java, there are several disadvantages to using constructors with large parameter lists. To help illustrate, I include a code listing below.
Employee.java
package dustin.examples;
/**
* Simple employee class intended to illustrate NetBeans 7.2 and refactoring
* constructor to use Builder pattern as discussed in Item #2 of the Second
* Edition of Joshua Bloch's <em>Effective Java</em>.
*
* @author Dustin
*/
public class Employee
{
private String lastName;
private String middleName;
private String firstName;
private long id;
private int birthYear;
private int birthMonth;
private int birthDate;
private int hireYear;
private int hireMonth;
private int hireDate;
public Employee(
final String newLastName,
final String newMiddleName,
final String newFirstName,
final long newId,
final int newBirthYear,
final int newBirthMonth,
final int newBirthDate,
final int newHireYear,
final int newHireMonth,
final int newHireDate)
{
this.lastName = newLastName;
this.middleName = newMiddleName;
this.firstName = newFirstName;
this.id = newId;
this.birthYear = newBirthYear;
this.birthMonth = newBirthMonth;
this.birthDate = newBirthDate;
this.hireYear = newHireYear;
this.hireMonth = newHireMonth;
this.hireDate = newHireDate;
}
}
Employee's parameterized constructor includes numerous parameters and this presents a challenge to clients of this class that need to create a new instance of it. This particular constructor is particularly tricky for clients because it has three consecutive String parameters and numerous consecutive int parameters. It is all too easy for a client to mix up the order of these same-typed parameters in the invocation.
Suppose that business logic is such that an employee should be instantiable with only a last name, first name, and ID provided. In other words, suppose that all attributes of the class are optional except for the three just mentioned. In such a case, with only a constructor like that one above, the client would need to pass null for the middle name String and zeroes or some other number without meaning. The numeric types could be reference types rather than primitives, but the clients would still need to pass null for each optional argument.
One might argue that a three-argument constructor could accepting the three required attributes' values could be supplied and then appropriate set methods could be invoked to set each optional attribute. However, this approach has drawbacks. For one, it makes it easier for the client to accidentally instantiate an instance with a bad or partial state. In some cases, it is not desirable to change the state of the object after instantiation, but the presence of the set methods make it more mutable than desired. Indiscriminate supplying of set methods hasseveral drawbacks in the world of concurrency and object-oriented interfaces.
An elegant approach that allows a client to only supply optional parameters that are meaningful without supplying otherwise unnecessary set methods is the Builder pattern. NetBeans 7.2 makes it easy to refactor the constructor with the long parameter list in the above example to take advantage of an instance of Builder. The next screen snapshot shows how I can use NetBeans 7.2 to accomplish this by hovering over the parameterized constructor, right-clicking on it, and selecting the option "Replace constructor with Builder...".

When this option is selected a popup similar to that shown in the next screen snapshot appears.

The refactoring tool only allows parameters passed to the constructor being refactored to be set in the builder. I can check the boxes of the optional attributes. When I make an attribute optional without supplying a default value, a warning appears as shown in the next screen snapshot.

If I supply default values (null for the String and zero for the integers that should never be zero for valid values), the warnings go away.

It is worth pointing out here that the refactor tool allows the refactor to continue when only warnings (no errors) are present. An error might be caused, for example, by declaring a package and class name of the builder to be generated with a name used by an existing class.
The "Preview" button can be clicked to see what the class would look like without actually creating the class file. When the "Refactor" button is clicked, a new Java class with the package and class name indicated in the "Builder Class Name" text field is created. The result in this case is shown in the next screen snapshot with the generated code listed in a listing following the snapshot.

NetBeans 7.2-Generated EmployeeBuilder.java
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package dustin.examples;
public class EmployeeBuilder
{
private String newLastName;
private String newMiddleName = null;
private String newFirstName;
private long newId;
private int newBirthYear = 0;
private int newBirthMonth = 0;
private int newBirthDate = 0;
private int newHireYear = 0;
private int newHireMonth = 0;
private int newHireDate = 0;
public EmployeeBuilder()
{
}
public EmployeeBuilder setNewLastName(String newLastName)
{
this.newLastName = newLastName;
return this;
}
public EmployeeBuilder setNewMiddleName(String newMiddleName)
{
this.newMiddleName = newMiddleName;
return this;
}
public EmployeeBuilder setNewFirstName(String newFirstName)
{
this.newFirstName = newFirstName;
return this;
}
public EmployeeBuilder setNewId(long newId)
{
this.newId = newId;
return this;
}
public EmployeeBuilder setNewBirthYear(int newBirthYear)
{
this.newBirthYear = newBirthYear;
return this;
}
public EmployeeBuilder setNewBirthMonth(int newBirthMonth)
{
this.newBirthMonth = newBirthMonth;
return this;
}
public EmployeeBuilder setNewBirthDate(int newBirthDate)
{
this.newBirthDate = newBirthDate;
return this;
}
public EmployeeBuilder setNewHireYear(int newHireYear)
{
this.newHireYear = newHireYear;
return this;
}
public EmployeeBuilder setNewHireMonth(int newHireMonth)
{
this.newHireMonth = newHireMonth;
return this;
}
public EmployeeBuilder setNewHireDate(int newHireDate)
{
this.newHireDate = newHireDate;
return this;
}
public Employee createEmployee()
{
return new Employee(newLastName, newMiddleName, newFirstName, newId, newBirthYear, newBirthMonth, newBirthDate, newHireYear, newHireMonth, newHireDate);
}
}
As the screen snapshot and code listing above indicate, NetBeans 7.2 generated a builder based on the constructor. This was easily done, but there are a few things I don't like about it as much as the builders I have generated by hand. For the builders I have built by hand, I have chosen to have required attributes be part of the builder's constructor so that they must be supplied (I had expected this to happen for the parameters that I did not check the box for optional on). This is shown in the next code listing, which is an adaptation of the generated code shown above. The only thing changed from above is the builder's constructor. It now takes parameters for the Employee class's required attributes.
Adapted EmployeeBuilder.java
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package dustin.examples;
public class EmployeeBuilder
{
private String newLastName;
private String newMiddleName = null;
private String newFirstName;
private long newId;
private int newBirthYear = 0;
private int newBirthMonth = 0;
private int newBirthDate = 0;
private int newHireYear = 0;
private int newHireMonth = 0;
private int newHireDate = 0;
public EmployeeBuilder(
final String newBldrLastName, final String newBldrFirstName, final String newBldrMiddleName)
{
this.newLastName = newBldrLastName;
this.newFirstName = newBldrFirstName;
this.newMiddleName = newBldrMiddleName;
}
public EmployeeBuilder setNewLastName(String newLastName)
{
this.newLastName = newLastName;
return this;
}
public EmployeeBuilder setNewMiddleName(String newMiddleName)
{
this.newMiddleName = newMiddleName;
return this;
}
public EmployeeBuilder setNewFirstName(String newFirstName)
{
this.newFirstName = newFirstName;
return this;
}
public EmployeeBuilder setNewId(long newId)
{
this.newId = newId;
return this;
}
public EmployeeBuilder setNewBirthYear(int newBirthYear)
{
this.newBirthYear = newBirthYear;
return this;
}
public EmployeeBuilder setNewBirthMonth(int newBirthMonth)
{
this.newBirthMonth = newBirthMonth;
return this;
}
public EmployeeBuilder setNewBirthDate(int newBirthDate)
{
this.newBirthDate = newBirthDate;
return this;
}
public EmployeeBuilder setNewHireYear(int newHireYear)
{
this.newHireYear = newHireYear;
return this;
}
public EmployeeBuilder setNewHireMonth(int newHireMonth)
{
this.newHireMonth = newHireMonth;
return this;
}
public EmployeeBuilder setNewHireDate(int newHireDate)
{
this.newHireDate = newHireDate;
return this;
}
public Employee createEmployee()
{
return new Employee(newLastName, newMiddleName, newFirstName, newId, newBirthYear, newBirthMonth, newBirthDate, newHireYear, newHireMonth, newHireDate);
}
}
The code used to call the adapted builder shown in the last code listing is exemplified in the following code listing. This code listing demonstrates how readable ("fluent" in the more trendy vernacular) the client code is with the builder and demonstrates that the object is never in a partial or inconsistent state.
package dustin.examples;
import java.util.Calendar;
/**
* Example calling adapted employee builder to get an instance of employee.
*
* @author Dustin
*/
public class Main
{
public static void main(final String[] arguments)
{
final Employee employee =
new EmployeeBuilder("Coyote", "Wile", "E.")
.setNewBirthMonth(Calendar.SEPTEMBER)
.setNewBirthDate(17)
.setNewBirthYear(1949)
.createEmployee();
}
}
The most significant drawbacks to the builder implementation are potential performance impacts of extra object instantiation (probably not an issue for most Java applications) and the extra code verbosity.
Although I don't show it here, the other thing I like to do with my builder implementations is to include them as nested classes in the class they build. This is how the code example in the second item of the Second Edition of Effective Java implements it, but I don't see anyway in NetBeans 7.2 to generate the builder as a nested class rather than as a standalone class.

Android 4.1 Jelly Bean hands-on impressions (update: video!)

Gallery Photo: Google Nexus 7 by Asus hands-on pictures

Android 4.1 Jelly Bean hands-on impressions (update: video!)

We've shown you the Google Nexus 7 by Asus and told you about the surprising quality you'll get starting at $199, but the most important part of the tablet is arguably the software that's inside. Android 4.1 Jelly Bean is here at Google I/O, and we've just spent some quality time with the new revision of the OS. As you'd expect from the ".1," it's not a giant leap forward from Ice Cream Sandwich on phones, but it brings some fairly exciting new features, major tweaks, and brings the tablet version of the OS (at least at this Nexus 7's screen size) closer to that of the smartphone.

Recent Posts