strive out the ones existent 310-813 cutting-edge-day and updated dumps.
determined out this precise source after a long time. uncouth people privilege here is cooperative and in a position. team provided me excellent material for 310-813 education.

Extract concomitant uncouth 310-813 path contents in layout.
simply cleared 310-813 examination with pinnacle rating and should thank killexams.com for making it possible. I used 310-813 examination simulator as my number one statistics supply and were given a strong passing rating on the 310-813 exam. Very reliable, Im fortunate I took a bounce of religion purchasing this and trusted killexams. the whole lot may be very professionaland reliable. two thumbs up from me.

I need actual test questions of 310-813 exam.
310-813 examination changed into honestly difficult for me as i was now not getting enough time for the training. locating no way out, I took assist from the dump. I additionally took assist from responsible Certification guide. The dump was high-quality. It dealt with uncouth of the subjects in an smooth and friendly way. may want to acquire via most of them with microscopic effort. replied uncouth the query in just eighty one mins and were given 97 mark. Felt without a doubt satisfied. thanks plenty to killexams.com for his or her valuable guidance.

Start preparing these 310-813 questions answers and chillout.
My buddies informed me I ought to matter on killexams.com for 310-813 examination coaching, and this time I did. The brain dumps are very handy to apply, i actually relish how they may be installation. The question order facilitates you memorize things higher. I passedwith 89% marks.

where can i find 310-813 trendy dumps questions?
Thumb up for the 310-813 contents and engine. well worth buying. no doubt, refering to my buddies

discovered an accurate source for actual 310-813 present day dumps.
This exam preparation kit has proven itself to be absolutely worth the money as I passed the 310-813 exam earlier this week with the score of 94%. uncouth questions are valid, this is what they give you at the exam! I dont know how killexams.com does it, but theyve been keeping this up for years. My cousin used them for another IT exam years ago and says they were just as superior back in the day. Very responsible and trustworthy.

Is there any way to lucid 310-813 exam before everything attempt?
killexams.com is the most standard manner ive ever long past over to acquire prepared and bypass IT exams. I want more people notion approximately it. yet then, there could be more dangers someone should shut it down. The aspect is, it provides for the same factor what I should recognize for an examination. Whats greater I express diverse IT checks, 310-813 with 88% marks. My associate utilized killexams.com for lots special certificates, uncouth outstanding and large. completely stable, my character top selections.

Get 310-813 certified with actual Take a study at question monetary institution.
I passed the 310-813 exam thanks to this bundle. The questions are accurate, and so are the topics and study guides. The format is very convenient and allows you to study in different formats - practicing on the testing engine, reading PDFs and printouts, so you can work out the style and equilibrium thats privilege for you. I personally loved practicing on the testing engine. It fully simulates the exam, which is especially indispensable for 310-813 exam, with uncouth their specific question types. So, its a springy yet responsible way to obtain your 310-813 certification. Ill be using killexams.com for my next even certification exams, too.

Do not spend vast amount on 310-813 guides, acquire this question bank.
This killexams.Com from helped me acquire my 310-813 colleague confirmation. Their substances are clearly beneficial, and the exam simulator is surely splendid, it completely reproduces the examination. Topics are lucid very without problems the exhaust of the killexams.Com suffer a study at fabric. The examination itself turned into unpredictable, so Im fortunate I utilized killexams.Com . Their packs spread uncouth that I need, and I wont acquire any unsavory shocks amid your examination. Thanx Guys.

located an amend source for actual 310-813 existent exam questions.
I passed the 310-813 exam and pretty suggest killexams.com to each person who considers shopping for their substances. This is a completely valid and dependable guidance device, a tremendous chance for people who cant manage to pay for signing up for full-time publications (thats a waste of money and time if you inquire from me! Specially when you suffer Killexams). If you suffer been wondering, the questions are actual!

SUN SUN Sun Certified MySQL

sun Plans Open supply buying Spree, Completes MySQL Deal
solar Microsystems nowadays talked about it has completed its $1 billion acquisition of open supply database supplier MySQL and may circulate aggressively to purchase other open supply carriers.

whereas no selected aims were stated, sun President and CEO Jonathan Schwartz stated the MySQL acquisition may be a key share in solar's application to transform itself into a key provider of open source utility.

"Open source is definitely within the DNA of sun," Schwartz said. "As such, once they appear to be across the market, these corporations that suffer constructed good, high-integrity communities and suffer big distribution and a few measure of commercial success are the ones we're going to be most attracted to."

"there may be a transforming into number of totally bewitching and totally resourceful open supply organizations available and they trust they are a herbal domestic for lots of them and we're actually going to be placing their stability sheet to work to head manufacture that the case," Schwartz referred to.

regardless of sun's moves to dwelling itself as a key open source issuer by way of OpenSolaris, Java, NetBeans and its GlassFish software server residences, industry officials stated gaining MySQL will let solar tap into MySQL's stated 11 million subscribers whereas giving credence to MySQL as an option database platform to industry shoppers.

"MySQL is among the most profitable manufacturers in the free and open source delicate world," mentioned wealthy green, government vp of solar's application company. "This combination strengthens solar's position because the greatest contributor to the open supply neighborhood and offers solar a dramatically more desirable attain."

sun first introduced its intent to acquire MySQL in mid-January and spoke of both organizations moved directly to immediate the deal. MySQL CEO Marten Mickos will reside on with solar as senior vice chairman of the enterprise's fresh database neighborhood.

solar also moved without retard to transition the MySQL product line. The industry talked about clients can download the database freed from saturate privilege here. commercial enterprise consumers can now subscribe to MySQL's complete product line. sun referred to it's offering trial subscriptions freed from can charge.

The company additionally launched MySQL enterprise unlimited , a subscription-based provider for the deployment and management of any variety of MySQL industry Servers.

concerning the writer

Jeffrey Schwartz is editor of Redmond journal and also covers cloud computing for Virtualization overview's Cloud report. moreover, he writes the Channeling the Cloud column for Redmond Channel partner. follow him on Twitter @JeffreySchwartz.

solar Basket has launched meal kits that meet the American cancer Society's dietary guidelines. The company says the ACS recommends a eating regimen high in greens, fruits, entire grains, and skinny proteins however low in purple and processed meat. sun Basket is offering plant-forward vegan, vegetarian, and pescatarian plans for those seeking to consume by way of these requisites.

govt Chef Justine Kelly, the former head chef on the Slanted Door, a James Beard Award-winning restaurant, created the plans, which proffer nutritionally balanced nutrition with globally impressed flavors. And the products are made with organic produce and immaculate materials.

The enterprise notes that here's one of a couple of health-oriented improvements. different initiatives consist of partnering with the American Diabetes affiliation on a diabetes-pleasant meal contrivance and offering coronary heart-determine licensed recipes that meet American coronary heart association requisites.

based on a concomitant announcement, Wi-sun Alliance has adopted the Renesas Electronics supplier, a employer of superior semiconductor options, sub-gigahertz (Sub-G) instant retort as a candidate of the interoperability verify mattress units (TBUs) for the Wi-sun FAN (container zone network) Certification program.

Renesas is a component of the primary wave of groups taking share in the Wi-solar FAN 1.0 certification mode with its RAA604S00/RX651 instant solution. Certifications are deliberate by means of the discontinuance of 2018.

The Sub-G instant solution points Tessera technology’s contrast platform, which contains an assessment board3 hooked up with Renesas’ RAA604S00 instant communications device-on-chip (SoC) and RX651 microcontroller (MCU), in addition to communication control software offered through Renesas. Renesas will note the fresh Sub-G instant retort at its booth (stand B.c44) at European Utility Week 2018, November 6 to November eight, in Vienna, Austria.

“The Wi-sun neighborhood has been making big strides within the edifice and deployment of instant communications in the energy administration programs trade, and they are pleased to expand their commitment to the wise energy markets and boost the newest Wi-solar requirements with their Wi-sun FAN-licensed retort and test mattress units,” mentioned Akihiro Kuroda, VP, power Infrastructure enterprise Division, Renesas Electronics company.

The Sub-G company offers elements which are resilient to physical limitations and might transmit facts even further than supported by using past specifications, even in city environments. considering broad areas may also be covered with respectable steadiness via mesh networks, it is acceptable for applications such sensible meter conversation, energy utilization visualization, monitoring device utilization, and managing quite a lot of sensors inside a utility, factories and structures.

strive out the ones existent 310-813 cutting-edge-day and updated dumps.
determined out this precise source after a long time. uncouth people privilege here is cooperative and in a position. team provided me excellent material for 310-813 education.

Extract concomitant uncouth 310-813 path contents in layout.
simply cleared 310-813 examination with pinnacle rating and should thank killexams.com for making it possible. I used 310-813 examination simulator as my number one statistics supply and were given a strong passing rating on the 310-813 exam. Very reliable, Im fortunate I took a bounce of religion purchasing this and trusted killexams. the whole lot may be very professionaland reliable. two thumbs up from me.

I need actual test questions of 310-813 exam.
310-813 examination changed into honestly difficult for me as i was now not getting enough time for the training. locating no way out, I took assist from the dump. I additionally took assist from responsible Certification guide. The dump was high-quality. It dealt with uncouth of the subjects in an smooth and friendly way. may want to acquire via most of them with microscopic effort. replied uncouth the query in just eighty one mins and were given 97 mark. Felt without a doubt satisfied. thanks plenty to killexams.com for his or her valuable guidance.

Start preparing these 310-813 questions answers and chillout.
My buddies informed me I ought to matter on killexams.com for 310-813 examination coaching, and this time I did. The brain dumps are very handy to apply, i actually relish how they may be installation. The question order facilitates you memorize things higher. I passedwith 89% marks.

where can i find 310-813 trendy dumps questions?
Thumb up for the 310-813 contents and engine. well worth buying. no doubt, refering to my buddies

discovered an accurate source for actual 310-813 present day dumps.
This exam preparation kit has proven itself to be absolutely worth the money as I passed the 310-813 exam earlier this week with the score of 94%. uncouth questions are valid, this is what they give you at the exam! I dont know how killexams.com does it, but theyve been keeping this up for years. My cousin used them for another IT exam years ago and says they were just as superior back in the day. Very responsible and trustworthy.

Is there any way to lucid 310-813 exam before everything attempt?
killexams.com is the most standard manner ive ever long past over to acquire prepared and bypass IT exams. I want more people notion approximately it. yet then, there could be more dangers someone should shut it down. The aspect is, it provides for the same factor what I should recognize for an examination. Whats greater I express diverse IT checks, 310-813 with 88% marks. My associate utilized killexams.com for lots special certificates, uncouth outstanding and large. completely stable, my character top selections.

Get 310-813 certified with actual Take a study at question monetary institution.
I passed the 310-813 exam thanks to this bundle. The questions are accurate, and so are the topics and study guides. The format is very convenient and allows you to study in different formats - practicing on the testing engine, reading PDFs and printouts, so you can work out the style and equilibrium thats privilege for you. I personally loved practicing on the testing engine. It fully simulates the exam, which is especially indispensable for 310-813 exam, with uncouth their specific question types. So, its a springy yet responsible way to obtain your 310-813 certification. Ill be using killexams.com for my next even certification exams, too.

Do not spend vast amount on 310-813 guides, acquire this question bank.
This killexams.Com from helped me acquire my 310-813 colleague confirmation. Their substances are clearly beneficial, and the exam simulator is surely splendid, it completely reproduces the examination. Topics are lucid very without problems the exhaust of the killexams.Com suffer a study at fabric. The examination itself turned into unpredictable, so Im fortunate I utilized killexams.Com . Their packs spread uncouth that I need, and I wont acquire any unsavory shocks amid your examination. Thanx Guys.

located an amend source for actual 310-813 existent exam questions.
I passed the 310-813 exam and pretty suggest killexams.com to each person who considers shopping for their substances. This is a completely valid and dependable guidance device, a tremendous chance for people who cant manage to pay for signing up for full-time publications (thats a waste of money and time if you inquire from me! Specially when you suffer Killexams). If you suffer been wondering, the questions are actual!

Obviously it is difficult assignment to pick solid certification questions/answers assets concerning review, reputation and validity since individuals acquire sham because of picking incorrectly benefit. Killexams.com ensure to serve its customers best to its assets concerning exam dumps update and validity. The vast majority of other's sham report objection customers Come to us for the brain dumps and pass their exams cheerfully and effectively. They never trade off on their review, reputation and trait because killexams review, killexams reputation and killexams customer assurance is vital to us. Uniquely they deal with killexams.com review, killexams.com reputation, killexams.com sham report grievance, killexams.com trust, killexams.com validity, killexams.com report and killexams.com scam. In the event that you contemplate any unfounded report posted by their rivals with the name killexams sham report grievance web, killexams.com sham report, killexams.com scam, killexams.com dissension or something relish this, simply recall there are constantly terrible individuals harming reputation of superior administrations because of their advantages. There are a mighty many fulfilled clients that pass their exams utilizing killexams.com brain dumps, killexams PDF questions, killexams hone questions, killexams exam simulator. Visit Killexams.com, their specimen questions and test brain dumps, their exam simulator and you will realize that killexams.com is the best brain dumps site.

Looking for 310-813 exam dumps that works in existent exam?Are you looking for SUN 310-813 Dumps of existent questions for the Sun Certified MySQL 5.0 Developer Part(R) II Exam prep? They provide recently updated and mighty 310-813 Dumps. Detail is at http://killexams.com/pass4sure/exam-detail/310-813. They suffer compiled a database of 310-813 Dumps from existent exams if you want to can back you establish together and pass 310-813 exam on the first attempt. Just establish together their and relax. You will pass the exam.

We suffer Tested and Approved 310-813 Exam dumps. killexams.com provides the foremost distinctive and latest 310-813 braindumps that much comprise uncouth s you need. With the lead of their 310-813 exam dumps, you ought to not squander your risk on spending time on reference books and nearly suffer to be compelled to spend 10-20 hours to ace their 310-813 existent Questions and Answers. Whats larger, they suffer an approach to proffer you with PDF Version and Exam Simulator Version test Questions and Answers. For Exam Simulator Version dumps, the candidates mimic the SUN 310-813 exam in an exceedingly existent test atmosphere.
killexams.com Discount Coupons and Promo Codes are as under;
WC2017 : 60% Discount Coupon for uncouth exam on website
PROF17 : 10% Discount Coupon for Orders additional than $69
DEAL17 : 15% Discount Coupon for Orders additional than $99
SEPSPECIAL : 10% Special Discount Coupon for uncouth Orders
Click http://killexams.com/pass4sure/exam-detail/310-813

if you are hunting down 310-813 practice Test containing existent Test Questions, you're at precise locale. killexams.com suffer accumulated database of questions from Actual Exams keeping up as a top priority the stop objective to empower you to devise and pass your exam on the essential endeavor. uncouth instructing materials at the site are Up To Date and verified by mode for their pros.

killexams.com give latest and updated Pass4sure practice Test with Actual Exam Questions and Answers for fresh syllabus of SUN 310-813 Exam. practice their existent Questions and Answers to improve your insight and pass your exam with high Marks. They guarantee your prosperity inside the Test Center, securing each one of the subjects of exam and enhance your learning of the 310-813 exam. Pass with no uncertainty with their actual questions.

Our 310-813 Exam PDF consolidates Complete Pool of Questions and Answers and Dumps verified and certified together with references and clarifications (inmaterial). Their goal to collect the Questions and Answers isn't essentially to pass the exam at first endeavor however Really improve Your learning roughly the 310-813 exam references.

310-813 exam Questions and Answers are Printable in high trait Study lead that you can download for your Computer or some unique machine and originate putting in your 310-813 exam. Print Complete 310-813 Study Guide, pass on with you while you are at Vacations or Traveling and luxuriate in your Exam Prep. You can acquire to updated 310-813 Exam out of your online record at whatever point.

Sun Certified MySQL 5.0 Developer Part(R) II

To enumerate means to itemize or to list. In the world of programming, enumerations, enums for short, are used to delineate a finite set of values (constants) that a variable can attain. In other words, it defines the domain of a type. For instance, different states of a fan switch - off, low, medium, and high - manufacture up an enumeration.

Since the first release of Java, programmers suffer been complaining about the want of core language support for enumerated types. After all, Java improvised on the shortcomings of C++ and touted type safety, so it was only natural for the developer community to hope support for a precise enum-type. During what seemed relish an eternally long wait, many ad-hoc enum representations evolved and most of them shared a common premise - modeling enumerations based on a primitive type, usually an int; contemplate Listing 1 for an example.

Although practical, such implementations suffer long been frowned upon by Java purists as a hack that can best be described as brittle. What exactly is wrong with such an implementation? In essence, the main detriment of faking enumerated types using primitives is the want of strong typing and hence the inability to snare errors at compile time. Other shortcomings are less readable code, deviations from object-oriented concepts such as encapsulation, the absence of a namespace requiring an definite prefix for uncouth references, and the dangers of exposing the internal implementation to client code.

Let's study at some of these drawbacks in more detail.

Loose type checking is the result of a compiler treating the faked enumeration just relish any other primitive variable. Since the compiler doesn't know anything about the cohesiveness of the enumeration of constant values, it doesn't catch, for instance, a definitive assignment of an out of purview value. In other words, want of an definite type totally gives away the benefits of compile-time oversight detection.

Such ad hoc approaches violate some of the basic object-oriented principles. In the previous example, the states of the switch want encapsulation. Attributes representing the constants and operations are not grouped together but are scattered within the enclosing scope. Since the client code is well vigilant of implementation details, even a small change such as renumbering them might result in broken client code. also note the want of definite scoping. Since enum attributes are listed along with other class attributes, the enclosing scope is often that of the declaring class or interface. This makes their grouping vague, unreadable, and sometimes oversight prone.

In his reserve effective Java, Joshua Bloch presents a pattern for type-safe enums that offers both compile-time safety and better encapsulation. java.awt.Color uses a similar strategy to mask the int-enum implementation under the sheet. However, after reading through pages plenary of Java code, you originate to wonder if the juice is worth the squeeze. It only reinforces the need for core language support for enum types. For a language that touts type safety, the notion of faking enums with such elaborate pyrotechnics seems rather odd.

Enter the fresh EnumThe wait is finally over and precise enums are here. Enums are a type of their own in J2SE 5.0. Among many other developer-friendly features recommended in JSR 176, Tiger (the code name for the fresh release) packs the powerful punch of type-safe enums. Listing 2 shows how they rewrite Fan.java using precise enums. (Listings 2-9 can be downloaded from www.sys-con.com/java/sourcec.cfm.)

Note the fresh enum keyword introduced to support the fresh type and also how enumerated constants are listed - they are neither strings nor ints but belong to their own declared type, i.e., SwitchState. Because it's a precise type, uncouth the benefits of strong typing automatically kick in. For instance, the following code attempting to set an invalid state

new Fan().setState(6);

is automatically detected at compile time and reported an error, eliminating the need for several lines of validation code:

setState(Fan.SwitchState) in Fan cannot be applied to (int)

Let's study at other useful features provided by the enum type.

Support for NamespaceIn the previous example, uncouth the listed constants, e.g., states of the fan switch, implicitly belong to the enclosing type, appropriately named SwitchState, requiring an definite namespace qualification to uncouth references to states. For example:

SwitchState.Low

Namespace adornment also helps avoid collisions. If they were to declare another enum type for class Fan using a similar set of constants, say:

public enum DurabilityRating { Low, Medium, high }

it will result in no name collision. SwitchState.Low can be distinguished from DurabilityRating.Low because of their enclosing scope.

Since enum SwitchState is declared as public, and with the type system providing a namespace for each enum constant, it can be accessed outside the scope of class Fan just relish any average impute reference, e.g., Fan.SwitchState.Medium.

Auto Conversion to String ValuesThe fresh enum type easily facilitates descriptive printing using an internal implementation of the toString() method. The default implementation returns a string representation of the constant as declared, and, if you don't relish it, it can be changed by overriding toString(). It's that simple.

Works with Programming ConstructsSince enums are their own types, some of the standard Java constructs, notably the switch and for statements, suffer been enhanced to work with enum types. Listing 3 provides an instance of the switch construct.

Switch statements are useful for simulating the addition of a mode to an enum type from outside the type. This can be very useful if for some reason the enum definition cannot be modified, but needs to be extended.

There is something rather bewitching about this switch statement - note how the enum constants in case statements loom bare, e.g., unqualified with their namespace. J2SE 5.0 makes life easier by attempting to resolve identifiers in the immediate context. This is partially similar to the fresh static imports feature. In this example, however, you are required to omit the namespace. Try including it and you'll acquire an oversight message:

Fan.java:16: an enum switch case label must be the unqualified name of an enumeration constant
case SwitchState.Off : return SwitchState.Low ;

Listing 4 provides an instance that uses a for-loop construct to iterate through enums.

The values() mode returns an array that contains enum constants for this enum in the order in which they are declared. By the way, the for-loop shown here is called "enhanced for-loop", another elegant feature in the fresh release. They are also called as "for-in loop" since you read them as "for-state-in-Switchstate.values". This fresh construct simplifies iterating over a collection of values - both arrays and Java collections - by taking away the need to inspect the size, exhaust a temporary index variable, and cast each ingredient to the arrogate type.

Looking Under the HoodIn the spirit of empiricism, let's study under the hood and contemplate how enums are implemented. Compiling Fan.java (for the complete source code contemplate the resources section) generates two .classes: Fan.class and Fan$SwitchState.class. The latter contains their enum definition.

D:\MyJava\JDJ\src>javap Fan$SwitchState
Compiled from "Fan.java"
public final class Fan$SwitchState extends java.lang.Enum{
public static final Fan$SwitchState Off;
public static final Fan$SwitchState Low;
public static final Fan$SwitchState Medium;
public static final Fan$SwitchState High;
public static final Fan$SwitchState[] values();
public static Fan$SwitchState valueOf(java.lang.String);
static {};
}

As you can see, the process of compilation results in the automatic generation of a fresh class that extends java.lang.Enum. In other words, the enum keyword acts as a shorthand representation for the autogenerated class. This is what the authors of JSR 201 meant by "linguistic support for type-safe enumeration pattern." It's worth mentioning that every fresh language extension introduced in Java 5.0 is implemented by modifying the source-to-byte code compiler so the JVM implementation remains unchanged.

If you notice the naming convention adopted for generated enum types, you'll recognize that they closely resemble the inner class syntax, e.g., <enclosingType>$<thisType> format. uncouth enum classes are final subclasses of java.lang.Enum, serializable, and comparable. They Come with predefined toString, hashCode, and equals methods. uncouth methods except toString are final.

Note that uncouth enlisted enum constants are represented as final self-type variables of the class. This is done to ensure no instances exist other than those in the generated class. In other words, enums are Singletons and, for the same reason, they can't be instantiated using fresh or cloned. The clone mode in java.lang.Enum throws a CloneNotSupportedException.

Since enums are compiled into their own class files, their definition can be changed, e.g., enum constants can be added, deleted, and reordered without having to recompile the clients. If you removed an enum constant that a client is using, you'll fail speedily with an oversight message.

Now let's study at some advanced features.

Flavors of DeclarationEnums can be declared in various flavors. The enum FanState above is an instance of an inline declaration. These are useful for defining enums that suffer a limited scope - the exhaust and throw type of enums. Since Java 5.0 introduces the keyword enum at the same even as class and interface keywords, enums can be declared just as you would a fresh class or an interface - in its own .java file (see Listing 5).

Normal rules of access visibility that apply to standalone Java classes also apply to enums, whether they are declared inline or in a separate file. For example, if you omitted the public keyword, the enum type will suffer the default package visibility and hence be accessible only within the package. Similarly if the SwitchState enum were to suffer a private access specifier, it wouldn't be accessible outside the class scope of Fan. You acquire the point.

As with other fresh features introduced in Java 5.0 such as generics, enums suffer been used in several JDK packages. JDK 5.0 includes several enum types to support core classes. For instance, the newly introduced java.lang.Thread class uses an enum named State to delineate the current state of the thread. Some of the best enum candidates haven't been converted over yet - relish the most quoted Color class. You can exhaust Javadoc as your field lead for spotting enums in Tigerland. The fresh API Javadoc conveniently lists uncouth enums in the package-summary.html along with other top-level types. Once you suffer spotted them, streak ahead and open the source code and contemplate how the preachers practice. It's always fun.

Class-like BehaviorSince enums are class-like critters, they support most, if not uncouth (see the Caveat Emptor sidebar), semantics supported by average Java classes. The enum type definition can suffer one or more parameterized constructors, implement interfaces, and support class corpse elements such as attributes, methods, instance and static initializer blocks, and even inner classes.

In addition, capricious fields and methods can be added to individual enum constants. Such constant-specific class bodies define anonymous classes inside enum classes that extend the enclosing enum class. Listings 6-9 illustrate the exhaust of some of these features.

There's a lot to digest here, so let's tackle them one at a time.

We are defining three types of accounts as enums - checking, savings, and investment. First things first - they need some clarification of terminology here. Every enum constant has a declaring class, which is also called its type. The term "enum type" is used to refer to the declaring class, e.g., AccountType. When they exhaust the term "enum constant", it's referring to uncouth enlisted contents contained in the scope of AccountType, e.g., Checking, Savings, and Investment. It shouldn't be very confusing. Just mediate of any class declaration and its objects - the enum type is analogous to the class declaration and enum constants, the objects.

Enums Are ClassesSimilarities between a average class declaration and an enum declaration are difficult to miss. The enum type AccountType implements the IAccountType interface and has two constructors. What does it mean? To implement an interface, the enum type must implement every mode defined in the interface. Since uncouth enum constants are objects of the declared type, they share the common implementation of methods getAvgBalanceMethod and getInterest- Rate. An enum constant declaration, when followed by arguments, invokes the constructor defined by the enum type. In their example, the enum constant Savings invokes the constructor

AccountType(double interestRate)

with controversy 3.5.

All the standard rules of constructor overloading and selection specified by the Java Language Specification are followed here. Since enum constant Checking has no arguments following its declaration, it's necessary to provide a no-arg default constructor. If the enum class has no constructor declarations, a parameterless default constructor is automatically provided to match the implicit vacant controversy list.

Notice how an enum type can declare methods and attributes, again, just relish a average Java class. For member type declaration, uncouth rules of scoping, access specifiers, and visibility are valid and therefore must be followed with respect to instance variables and methods. There is something rather bewitching with the type AvgBalanceMethod. It's an enum within an enum. Since an enum type can support uncouth types of class members, they can support enums too. Since AvgBalanceMethod is declared as public, it's visible outside the scope of the enclosing AccountType. Notice how it's accessed in the Account class.

Constant Class BodiesEnum constants can be associated with an capricious class corpse often referred to as a constant class body. Such classes are very similar to anonymous class declarations (even named similarly) and are implicitly static. This means they can access only static defined in the enclosing scope. Since constant classes are implicit extensions of the enclosing class, they can override methods defined in the enum type. In their example, enum constant Investment overrides getAvgBalanceMethod defined by AccountType. In fact, it would be perfectly legal to declare AccountType as abstract and obligate every enlisted enum constant to implement methods in the interface in their constant class body. A word of caution: although support for constant class bodies is a very powerful feature, it may be wise to avoid stretching them because of the same reasons why unreasonable exhaust of anonymous classes is discouraged - they are less readable and difficult to debug.

It's indispensable to mention here that only a nonfinal instance mode in java.lang.Enum is the toString() method. You can override and implement the per-constant toString() mode to return a descriptive name for each enum constant. The default implementation of toString() returns just the string equivalent of the constant. Therefore, as illustrated in the example, it may be a superior notion to override when a more descriptive literal is necessary.

Before they proclaim victory, two fresh classes introduced for enum support deserve consideration: java.util.EnumMap and java.util.EnumSet. As their names suggest, they are enum-enabled counterparts of the standard Java collection implementation. They both require that each ingredient maintained by the collection belong to one enum type. In short, they won't let you mix and match enum constants from different types. It's rather bewitching that they both retain the elements, e.g., the enum constants, in their declared order, totally ignoring any custom implementation of the compareTo() method. be sure to check out their API documentation.

ConclusionThe fresh enums are a robust way to implement constant named lists and manufacture them a compelling alternative to ad hoc enum implementations. With class-like deportment and the capacity to support capricious class members, they are certainly bigger than they appear. Although you may not suffer an immediate need to exhaust them in your projects, or at least not every feature they offer, maintain them in your toolbox and you'll soon find them handy.

CAVEAT EMPTORLet the buyer beware: a simple axiom often used in commerce summarizes it well - it means the buyer lonesome is responsible for assessing the trait of a purchase before buying. Enums are so powerful, once you learn the ropes it's effortless to be tempted to stretch and execute "cool" things. Before you know it, contemptible things start happening.

Always check out the API spec and know the expected deportment before you establish something to use. As a smart programmer, you also need to know the limitations of the enums so that it can redeem your bacon some day.

1. You can't fresh enums: recall they are singletons. For the JVM to handle them properly, only one instance of each should exist. They are automatically created for you. Luckily the compiler catches definite instantiation. For the same reason, enum constructors are implicitly private. mediate about it.

2. You can't extend enums: One enum cannot extend another one. You can't extend the primordial java.lang.Enum either. That's how it works and if you are worried about this limitation, your design demands a second look. You shouldn't need a hierarchy of enums.

3. You can't declare enums locally: Enum types cannot exist in any scope lower than a class scope. You can't define them within a method.

4. Order matters: Within the enum type class body, the constants must loom before other class elements such as attributes, methods, and constructors. This is precise at least as of the 5.0 beta release.

5. No nulls please: An enum constant cannot be null. It's that simple.

6. Don't exhaust ordinal: Code that uses an ordinal() method, e.g., logic based on the position of an enum constant as it appears in the declaration, must be discouraged. Your code will demolish at runtime if constants are subsequently reordered. What's more, this is a runtime error. The compiler will not snare such a thing.

7. Everything that sounds the same, isn't: There are a few other classes in JDK 5.0 that sound very similar - Enumeration, EnumControl, to name a few. Don't assume they are enum implementations. Check the Javadoc.

8. Spare the serialization: Enum serialization isn't relish the average one you suffer seen. The process by which enum constants are serialized cannot be customized. Any class-specific writeObject and writeReplace methods defined by enum types are ignored during serialization. Similarly, any serialPersistentFields or serialVersionUID field declarations are also ignored - uncouth enum types suffer a fixed serialVersionUID of 0L. Again, this shouldn't concern you too much. Let the language Take care of the specifics.

Take a more expedient approach for developing MVC Web applications than you might Take using J2EE technologies.

By Deepak Vohra

03/07/2007

Ruby on Rails is an open source Web framework for developing Model-View-Controller (MVC) Web applications that access databases. Ruby on Rails is based on the object-oriented Ruby scripting language. The model class in a Ruby on Rails application specifies the data model. A connection with the database is obtained in the model class, and the database table from which data is to be retrieved is specified. The controller class specifies the actions (methods) that hold the industry logic to process data, and the view templates are the user interfaces (UIs) for the MVC application. Controller class methods are invoked from a view template, the controller class processes data using the model class, and it renders a view template or invokes another controller method.

Ruby on Rails doesn't require configuration files as does a Java 2 Platform, Enterprise Edition (J2EE) application. Ruby on Rails requires a Web server and a database, and it includes the WEBrick Web server. It is also preconfigured with the MySQL database. Let's study at how to exhaust Ruby on Rails to develop a Create-Read-Update-Delete (CRUD) application. A CRUD application is used essentially to create, manipulate, and delete database table entries.

Because a Rails application is of the MVC pattern, the model and controller classes are Ruby classes (.rb files). The model class models data and extends the ActionRecord::Base class. Models provide object-relational mapping (ORM) between industry objects and the database. The view templates are the UIs of a Ruby on Rails application and are represented with .rhtml or .rxml files. An RHTML view template is the more commonly used alternative and is Ruby-embedded HTML. The controller class extends the ActionController::Base class and specifies actions (methods) to process data. Ruby on Rails provides various commands to generate a Rails application and model and controller classes. Some Ruby on Rails commands are listed in Table 1.

Get On TrackBegin by installing Ruby on Rails and including RubyGems, the standard package manager used with Ruby applications and libraries. Here is the procedure to install Ruby on Rails:

Download the Ruby Windows Installer application by double-clicking the ruby185-21.exe application to start the Ruby Setup Wizard. Click Next, and read and accept the license agreement.

Select the default components to install, which comprehend the RubyGems package manager, and click Next.

Specify a directory to install Ruby (the default is c:/ruby), and click Next.

Choose a Start Menu folder, and click Install to install Ruby and RubyGems.

Install Rails by using the CD (change directory) command to manufacture c:/ruby the current directory, and then hasten this command to install Rails and its dependencies—note that the activerecord package implements the model layer of a Rails MVC application, and the actionpack package implements the view and controller:
gem install rails --include-
dependencies

Use Setup.exe to download and install MySQL 5.0, and create a MySQL Server instance.

Now let's create a Ruby on Rails application that represents a journal catalog. exhaust the rails command on the command line to create a Ruby on Rails application in the catalog directory from within the ruby directory:

rails catalog

The app directory contains the subdirectories controllers, models, and view for the controller classes, model classes, and view templates, respectively. The config directory contains the database.yml file in which the database configuration is specified. A Rails application may be hasten in progress (the default mode), test, or production mode.

For the instance here let's hasten the Rails application in progress mode. Modify the progress mode settings in the database.yml file to specify the database as mysql. The progress mode settings for the MySQL database should study relish this:

The db directory is used for migration scripts, which will be discussed shortly.

Now they need to create a database table that will exhaust ActiveRecord migrations. A migration class extends the ActiveRecord::Migration class and is hasten with the rake command. The rake command is similar to Ant's build tool for creating J2EE applications. A migration script gets created when a model class script is created. Create a model script with this command in the Ruby Console Window from the ruby/catalog directory:

ruby script/generate model catalog

The model class catalog.rb is created in the app/models directory, and the migration script 001_create_catalogs.rb is created in the db/migrate directory. The migration script class, CreateCatalogs, extends the ActiveRecord::Migration class:

The default migration script consists of the methods self.up and self.down. The self.up mode is invoked to hasten a migration and create a database table. exhaust the create_table transformation of the ActiveRecord::Migration class to create a database table called catalogs. ActiveRecord uses pluralization to map a model class to a database table. The model class is singular and uppercase, and the database table is plural and lowercase.

In the Ruby on Rails application instance the model class is Catalog and the database table is catalogs. The ActiveRecord::Migration class provides various transformations for a database. Some of the transformations are listed in Table 2.

Modify the migration script 001_create_catalogs.rb to create a database table, and then add data to the table. In the create_table transformation create a table called catalogs with the columns journal, publisher, edition, title, and author:

Listing 1 shows the complete migration script. hasten the migration with the rake command from the /ruby/catalog directory. Rails has a target called migrate to hasten migrations:

rake db:migrate

The catalogs database table is created in the MySQL database named mysql. The catalogs table has a primary key field of type int(11) and the auto_increment attribute, which generates a unique identity for fresh rows.

Develop a CRUD ApplicationBefore they develop a Ruby on Rails CRUD application, note that a Ruby on Rails application consists of these Ruby scripts and view templates:

Model class in the app/models directory

Controller class in the app/controllers directory

View templates (RHTML files) in the app/views directory

Previously they created a model class Ruby script. They exhaust an interface to create fresh entries in the database, retrieve entries, update entries, and delete entries. The interface to the data in the database is scaffolding. Scaffolding consists of controller and model Ruby classes and view templates. Rails provides two types of scaffolding, dynamic scaffolding and scaffolding created with the ScaffoldGenerator. You can create a dynamic scaffolding by adding this scaffold mode invocation to the controller class:

scaffold :modelname

The scaffold mode generates controller logic and view templates dynamically using a model class obtained with Rails naming conventions. The first note of the modelname is uppercase to obtain the model class. For example, if the modelname specified in the scaffold mode is catalog, the Catalog model class is used in the scaffolding.

Instance variables @catalog/@catalogs are used in the controller class; controller instance variables are also available in the view templates. The Rails framework provides the scaffold generator to create a controller class, a model class, and the scaffolding for a CRUD application. Scaffolding generated with the ScaffoldGenerator is similar to the one generated with the scaffold method, except that the controller logic and view templates are generated when the ScaffoldGenerator command is hasten instead of being generated dynamically. In the Ruby console window hasten the scaffold generator:

With the scaffolding these actions (methods) are generated in the controller class: index, list, show, new, create, edit, update, and destroy. The default view templates may be overridden with view templates in the views directory. For example, a custom view template edit.rhtml can be provided in the views/catalog directory.

Next, let's hasten the Ruby on Rails application in the WEBrick Web server. originate by starting the WEBrick server from the /ruby/catalog directory:

ruby script/server

Access the WEBrick Web server with the URL, http://localhost:3000 (see figure 1). pomp the list of catalog entries with the list view template, which is invoked with the URL, http://localhost:3000/catalogs/list. To create a fresh catalog entry click the fresh catalog link (see figure 2). In the fresh view template add a catalog entry, and click the Create button. A fresh catalog entry is added in the list view template. Click the note link to note a catalog entry. To delete a catalog entry click the slay link, and to edit a catalog entry click the Edit link (see figure 3).

Use the edit view template to modify the catalog entry; for example, modify the title and click the Edit button to update the catalog entry (see figure 4).

Ruby on Rails is simpler than J2EE for developing MVC Web applications. The JavaServer Pages (JSP), HTML, servlets, Enterprise JavaBeans (EJB), and configuration fields that are required in a J2EE application are not required for a Ruby on Rails application.

About the Author

Deepak Vohra, a Sun-certified Java programmer and Sun-certified Web component developer, has published numerous articles in industry publications and journals. Deepak is the author of the reserve "Ruby on Rails for PHP and Java Developers."

A couple of patterns that could reason Java bank exhaustion were identified from years of research at IBM. One bewitching scenario was observed when Java applications generated an unreasonable amount of finalizable objects whose classes had non-trivial Java finalizers.

What Is a Java Finalizer?A Java finalizer performs finalization tasks for an object. It's the contrary of a Java constructor, which creates and initializes an instance of a Java class. A Java finalizer can be used to accomplish postmortem cleanup tasks on an instance of a class or to release system resources such as file descriptors or network socket connections when an object is no longer needed and those resources suffer to be released for other objects. You don't need any controversy or any return value for a finalizer. Unfortunately the current Java language specification does not define any finalizers for a Java class or interface when a class or interface is unloaded. Let's Take a closer study at finalize() mode of java.lang.Object that provides an instance method, finalize() for finalization:

protected void finalize() throws Throwable

When a Java object is no longer needed, the space occupied by the object is supposed to be recycled automatically by the Java garbage collector. This is one of the significant differences in Java and is not organize in most structural programming languages relish C. If an instance of a class implements the finalize() method, its space cannot be recycled by the garbage collector in a timely fashion. Worst case, it may not be recycled at all.

Any instances of classes that implement the finalize() mode are often called finalizable objects. They will not be immediately reclaimed by the Java garbage collector when they are no longer referenced. Instead, the Java garbage collector appends the objects to a special queue for the finalization process. Usually it's performed by a special thread called a "Reference Handler" on some Java Virtual Machines. During this finalization process, the "Finalizer" thread will execute each finalize() mode of the objects. Only after successful completion of the finalize() mode will an object be handed over for Java garbage collection to acquire its space reclaimed by "future" garbage collection. I did not negative "current," which means at least two garbage collection cycles are required to reclaim the finalizable object. Sounds relish it has some overhead? You got it. They need several shots to acquire the space recycled.

Finalizer threads are not given maximum priorities on systems. If a "Finalizer" thread cannot maintain up with the rate at which higher priority threads reason finalizable objects to be queued, the finalizer queue will maintain growing and reason the Java bank to fill up. Eventually the Java bank will acquire exhausted and a java.lang.OutOfMemoryError will be thrown.

A Java Virtual Machine will never invoke the finalize() mode more than once for any object. If there's any exception thrown by the finalize() method, the finalization of the object is halted.

You are free to execute virtually anything in the finalize() mode of your class. When you execute that, tickle execute not hope the recollection space occupied by each and every object to be reclaimed by the Java garbage collector when the object is no longer referenced or no longer needed. Why? It is not guaranteed that the finalize() mode will complete the execution in timely manner. Worst case, it may not be even invoked even when there are no more references to the object. That means it's not guaranteed that any objects that suffer a finalize() mode are garbage collected. That's a potential hazard from a recollection management perspective and, needless to say, there is considerable overhead for queuing, dequeuing, running the finalize() method, and rescanning the object in the next garbage collection cycle.

If you want to hasten cleanup tasks on objects, respect finalizers as a ultimate apply and implement your own cleanup method, which will be more predictable. It's very risky to depend on finalizers for postmortem cleanup tasks, especially if your finalizable objects suffer references to indigenous resources.

Hands-on undergo with Java FinalizerWe can easily simulate this scenario with a couple of test applications and Take a study at dumps and traces to contemplate what's happening inside of the Java bank and threads for hands-on experience.

Let's build a couple of Java classes to recreate typical scenarios.

In ObjectWYieldFinalizer, they can implement the mode finalize() with Thread.yield() so that finalize() cannot complete its execution (see Listing 1) (Listings 1-7 can be downloaded here.)

The Thread.yield() mode prevents the currently executing thread from running and allows other threads to execute. If the Finalizer thread calls this finalize() method, it will pause its execution.

In ObjectWExceptionFinalizer, the finalizer() mode immediately throws a java.lang.IndexOutOfBoundsException. If the Finalizer thread calls this finalize() method, the object finalization won't be completed because of the exception and there's no second desultory to hasten the finalize() mode (see Listing 2).

It looks very complicated. Why execute they need those command-line options? Well, without those options, they only acquire a microscopic information about Java garbage collection activities relish this:

We only acquire a type of garbage collection (Full GC), total Java bank usage before garbage collection (50,815K), total Java bank usage after garbage collection (45,644K), a high watermark of total Java bank (50,816K), and time spent in the garbage collection (0.2276940 secs).

High watermark is the size of the current Java heap. The Java bank can expand its size up to a maximum size or compress to manage Java bank effectively.

The -XX:+PrintGCDetails option lets the JVM provide information on each generation in the Java heap.

We can contemplate Java bank usage and the time (in seconds) spent in Java garbage collection of each fresh generation, tenured generation, and permanent generation with the -XX:+PrintGCDetails option in the following example:

In tenured generation, Java bank usage was 43,897KB before this Java garbage collection. Java bank usage reached 47,295KB after Java garbage collection; 47296K is the size of the high watermark of the tenured generation; 0.2110999 second was spent to collect the tenured generation. Unfortunately they execute not contemplate the maximum size of each generation with the -XX:+PrintGCDetails option alone.

With -XX:+PrintGCTimeStamps, they can acquire a timestamp for each garbage collection relish this:

We can even contemplate the address purview of each generation. Unfortunately there's no timestamp for each garbage collection with -XX:+PrintHeapAtGC option alone.

The ultimate option, -XX:-HeapDumpOnOutOfMemoryError allows the JVM to dump the Java bank to a file when an allocation from the Java bank cannot be satisfied or a java.lang.OutOfMemoryError is thrown. This option was introduced in Sun Java 1.4.2 update 12 and Sun Java 5.0 update 7.

If you want to experiment with IBM's Java Virtual Machine, uncouth you need is a -verbosegc command-line option. You execute not need any of these: -XX:+PrintGCDetails -XX:+PrintGCTimeStamps -XX:+PrintHeapAtGC, or -XX:+HeapDumpOnOutOfMemoryError.

Let's Take a study at what happened to the class while they talked about Sun JVM's command-line option. We've got java.lang.OutOfMemoryError from TestObjectWYieldFinalizer:

"java.lang.OutOfMemoryError: Java bank space." That means they got Java bank space exhaustion. The JVM could not designate any more Java bank while running the mode java.lang.ref.Finalizer.register(), which is on line 72 of Finalizer.java. Finalizer.java? Of course, they did not write Finalizer.java. That's a share of the JVM. They can also check verbosegc.txt to which they redirected the garbage collection trace (see Listing 6).

About 3.711 seconds after the JVM started, they got java.lang.OutOfMemoryError. The Java bank dump is written to pid124.hprof.

Analysis of Java Garbage Collection TracesWe can exhaust a tool to dissect this trace. The IBM Pattern Modeling and Analysis Tool for Java Garbage Collector (PMAT) is one of top five technologies at alphaWorks. I suffer implemented patented algorithms to forecast future failures related to Java bank exhaustion in this tool. tickle refer to United States Patent No. 7,475,214 if you are interested in the algorithms. Although they don't need these algorithms to investigate simple problem relish this, you might be able to find situations where you could acquire some insight from fortune tellers. They can acquire a copy of the tool here.

The tool can also parse Sun's Java garbage collector traces, including the following:

Serial collector

Throughput/parallel collector

Concurrent collector

Incremental/train collector

We can start version 3.2 of the tool with a jar file in the download package. (V3.2 was the latest version when this article was written.)

# /usr/java5/bin/java -Xmx200m -jar ga32.jar

The tool provides a headless mode but let's bring up the graphical user interface mode for effortless demonstration. They can click on the "N" icon to open Sun's trace file. They can click on "I" for IBM's trace file as seen in figure 1.

We can contemplate in figure 2 the analysis result and recommendation virtually instantly.