[Logo] Mentawai In Action
  [Search] Search   [Recent Topics] Recent Topics   [Hottest Topics] Hottest Topics   [Members]  Member Listing   [Groups] Back to home page 
[Moderation Log] Moderation Log   [Register] Register / 
[Login] Login 
Mentawai Approach  XML
Forum Index » Introduction
Author Message
saoj



Joined: 22/12/2007 07:20:02
Messages: 22
Offline

So the Mentawai mission was already stated in the previous chapter:

Mentawai Mission wrote:
To be as simple as possible, as joyful as possible, to stay out of the way of the programmer, boosting his productivity!


The Mentawai philosophy and approach to accomplish its mission is:

Programmatic Configuration: Mentawai uses Convention Over Configuration but whenever you need or want to configure your controller, your filters, your validation, your IoC, your AutoWiring, etc. you will use a configuration file written in Java. You will NOT use annotations and you will NOT use XML. Back in 2005 when Mentawai was born, frameworks like Struts were abusing the use o XML, taking away the joy of programming. XML programming is definitely not cool. Annotations programming is not cool either. In 2004 Martin Fowler wrote the following about configuration:

Martin Fowler wrote:
A separate but often conflated issue is whether to use configuration files or code on an API to wire up services. For most applications that are likely to be deployed in many places, a separate configuration file usually makes most sense. Almost all the time this will be an XML file, and this makes sense. However there are cases where it's easier to use program code to do the assembly. One case is where you have a simple application that's not got a lot of deployment variation. In this case a bit of code can be clearer than separate XML file.

(...)

I often think that people are over-eager to define configuration files. Often a programming language makes a straightforward and powerful configuration mechanism. Modern languages can easily compile small assemblers that can be used to assemble plugins for larger systems. If compilation is a pain, then there are scripting languages that can work well also.

(...)

One thing we're seeing in the Java world at the moment is a cacophony of configuration files, where every component has its own configuration files which are different to everyone else's. If you use a dozen of these components, you can easily end up with a dozen configuration files to keep in sync.

(...)

My advice here is to always provide a way to do all configuration easily with a programmatic interface, and then treat a separate configuration file as an optional feature.


Source: http://martinfowler.com/articles/injection.html#CodeOrConfigurationFiles

The separate and independent configuration file in a Mentawai web project is called ApplicationManager. You can call it anything as long as it inherits from org.mentawai.core.ApplicationManager. Below is a simple example of an ApplicationManager:



Or you can use the less verbose versions of the methods:



Shortly after the first stable version of the Mentawai framework was released, I wrote an article for the JavaWorld site emphasizing the need to avoid the XML bloat. Although at that time a lot of people were defending the XML approach, it became very clear to us that the programmatic approach had many advantages:

- Less likely to contain errors or typos because it is compiled before it is loaded by the web application.

- Great IDE integration so that you can take advantage of code-completion, auto-compile, refactoring, inline documentation, etc.

- Great flexibility that only a programming language can offer so that you can use loops, ifs, methods, objects, etc., in other words, you make the configuration adapt to yourself and not the other way around.

- Ability to optionally use a dynamic scripting language such as BeanShell, Groovy, JRuby, etc. so that you can accomplish true dynamic configuration, in other words, changes in the configuration are automatically reloaded by the application without the need to restart the application.

- The good and old JavaDoc to document your configuration methods and classes.

More important than the advantages above is that programmatic configuration is more natural and joyful because we are talking about Java code and not another XML specification. XML is a markup language (not a programming language) designed to provide a platform independent representation of data. Unfortunately, in our opinion, people have taken its usage too far. For an example let's take a look on how Struts2 uses XML to do validation:


Source: http://struts.apache.org/2.x/docs/validation.html

Besides this boring and unnatural XML schema you should notice that it is actually mixing Java code with XML code. Some people may say "Who cares?" but our opinion is that this is not joyful or natural. A quick look around the Internet will reveal some more exotic things people are doing with XML.

OpenXava (http://www.gestion400.com/web/guest/tutorial)

OpenXava Site wrote:
OpenXava is a framework to develop easily business applications with XML and Java.

Its virtue resides in the fact that the heart of our applications is XML instead of Java.




Xalan: http://www.ibm.com/developerworks/library/x-xalanextensions.html

IBM Article wrote:
The Xalan XSLT processor can invoke almost any method in almost any Java™ class in the classpath.




Please note that we have nothing against these projects and that they surely have their scenarios, but we believe that XML Programming is definitely not the way to go for agile and joyful web development. The Mentawai approach since its inception was to eliminate all XML and perform any kind of configuration/setup using the Java programming language.


No Annotations: Although Annotations is a great improvement when compared to XML, its usage can also be taken to bad extremes. Plus when you annotate your code all over the place you are really scattering the configuration throughout your code. It is very likely that any change in your configuration will force a full rebuild of your application. Note that because a Mentawai web project makes use of a separate and independent Java class, any change in your configuration will not require a full rebuild. You can change, compile and redeploy just your configuration many times while your main application has not changed. You can even have different configuration files (different ApplicationManagers) that can be applied to the same web application.

Another drawback of annotations is that it will tie your code to the framework being used, in other words, any further compilation of your code will require the framework jar in the classpath. Maybe not a big deal for your actions, but definitely not something recommended for your business model. With the Mentawai approach of having a single centralized Java class for the configuration, this will never happen, in other words, your web application can be totally decoupled from the web framework.

Coming back to the issue of annotation abuse here is how Struts2 use annotations to perform validation:


Source: http://struts.apache.org/2.x/docs/validation-annotation.html

We believe that Annotations Programming can be as bad as XML Programming, therefore, to avoid this pitfall and to be different from the majority of web frameworks out there, Mentawai has decided to abolish any kind of annotation. The goal is to keep it clean and keep it simple without annotations, the only exception being @Override.

Full-stack: To do a web project before Mentawai was very easy, provided that you knew how to use and integrate close to 10 different Java frameworks. You can use Struts for the controller, JSTL for the JSPs, Hibernate for the persistence solution, C3P0 for the connection pool, Commons Validation for the validation, Spring for Inversion of Control and Auto-wiring, Commons Email for sending emails, Commons File Upload for uploading files, JAAS for authentication and authorization and perharps Tiles for templates, Log4J for logging and OSCache for caching. Everybody will probably agree that this is a Rube Goldberg machine very intimidating for newcomers. But this can be avoided with the abstraction power of any object-oriented programming language. The Mentawai approach is to use high levels of abstraction to shield all this complexity from the web developer. Some of these frameworks were actually incorporated by Mentawai so you don't need to know them to use them. You can start a Connection Pool, something very basic for all web applications, with two lines of code in the ApplicationManager. Under the hood Mentawai will setup and use a C3P0 connection pool for you. Same thing for sending emails. You don't need to know Commons Email to send an email message. You can just use some simple lines of code to send emails from Mentawai and under the hood it will use the Commons Email framework for you. For other features like Authentication, Inversion of Control, validation, etc. Mentawai implements its own simple and high level solution, so you can take advantage of them without having to bring a whole new framework into play. Although the Mentawai goal is to be a full-stack solution for web applications, it also offers integration with other frameworks such as Spring, Velocity, JSTL, Hibernate, etc.

Allow me to talk a little bit more about abstraction. With the rise of the Ruby programming language, which I like very much, Java was blamed of being a no pragmatic language and a very verbose language. If you compare Java with Ruby this statement is correct. No question about it. Let's take a look of how Java opens up a file to count its number of characters and how the same program could be done in Ruby.



Now the Ruby version:



Wow! At a first glance it really looks that Ruby is much more pragmatic and less verbose than Java. And it really is. However, with some abstraction power, we can solve this problem and put Java back in the game.



What we did was abstract the complexity inside another object called FileUtils. Some Ruby lovers will complain that we cheated, but now to count the chars of a file in Java has become very easy and pragmatic. That's exactly what the Mentawai framework tries to do for web development. The Mentawai approach is to abstract all the complexity so that the recurrent tasks of every web application become easy and straightforward every time you start a new project.

Convention over Configuration: This approach should be taken for granted by any framework that wants to be simple and productive. Mentawai uses Convention over Configuration (CoC) in many situations and you can even create your own conventions to override Mentawai's one. To have Convention over Configuration means to have defaults for everything and allow the user to change them through configurations.

Some examples of CoC in the Mentawai framework are the directories where the internationalization (i18n) files are located and the location of the JSP files for an action to which no consequence was specified. For example if you have coded a validation filter with the name UserValidation.java, the convention for the i18n file location is: /validation/UserValidation_locale.i18n. If you have the action add() inside the class UserAction.java the convention for the JSP file location is: /UserAction/add.jsp. Of course you can change these conventions with simple configuration methods, but only if you need or want to. And as we have already seen, when you want to escape from the Mentawai conventions you will use programmatic configuration to do so.
sdsfxffc



Joined: 15/03/2014 00:53:22
Messages: 1
Offline

Également l'avantage de chaussures Nike est la technologie à l'intérieur. Avec la Nike + iPod, placer un capteur dans la semelle de votre chaussure Nike et de visualiser la façon dont vous avez exécuté par la synchronisation avec votre iPod. Lorsque vous exécutez, l'iPod pistes de votre temps, la distance et les calories brûlées. Vous pouvez configurer votre iPod pour jouer de la musique pendant que vous séance d'entraînement. Commencez avec une belle chanson lente lorsque vous vous étirez, puis lorsque vous Nike Air Max 90 Pas Cher votre musique pop rapide vous savez le temps 5 minutes d'étirement vous adjuger, et son temps de courir ! Configurez votre Nike + iPod pour jouer de la musique rock quand vous voulez être dans votre zone de combustion des calories, puis de revenir à la pop lorsque vous exécutez ou du jogging à la vitesse normale.

Aussi pour Nike, ce besoin femelle est le nouveau thème de cible Nike. Il est bien connu que les principaux clients sur le marché sont les femmes. Pour les femmes, les couleurs et élégant sont leur premier but de choisir des chaussures Nike. Des chaussures de sport à la pluie bottes, Nike a transformer le goût de leurs chaussures pour les femmes, avec élégant de nouvelle mode, chaussures femmes Nike veulent atteindre le but que saisir le cœur de toutes les femmes. Spécialement Nike Boots, il a le maximum de performance et Nike Air Max 90 Femme très forts. Tout le matériel métallique offre une durabilité et de style. Visible au talon unité Air-Sole offre le summum en matière d'amorti. Les Bottes comportant une imperméabilité parfaite et un composé de semelle All- Trac pour la traction max sur tous types de terrains.

New term of World Cup quailifiers is beginning, with the match of Frence, people look forward to a great game playing by popular football players. Messi, KaKa, Cristinano Ronaldo are the most famous players in the world by their consummate skills. Volatile Agentina outlet become a suspense because of Maradona coach status. Brazil revenge of the fallen after World Cup make a great stimulate to football players. However, Cristiano Ronaldo injory news is the biggest pity for football fans. The most expensive football players in the world to be absent for three months implies the absence of qualifiers.Becoming the most expensive football players in the world, Cristiano Ronaldo always filled with gossip with his football skills. The performance in Nike Free Run Pas Cher Cup impressed people by his tears and also the football shoes he worn - nike Mercurial Vapor, purple colors is a bright star in the football field.

Nike Mercurial Vapors designed for Cristiano Ronaldo in World Cup 2010 is the forth series of original nike Mercurial Vapors, however, this orginal one is not designed for Cristinao Ronaldo. The original Nike Air Mercurial football boots made their appearance on the world stage in 1998. Ronaldo (the Brazilian striker, not Cristiano) launched the boots before the 1998 World Cup. Since then the boots have technologically progresses while maintaining the key principle of lightweight design and speed. The lightweight nature of the boot is achieved by both the materials used and the design construction. Carbon composites give strength to the boot while keeping weight to a minimum. Nike 'Flywire' technology is used which is basically a construction process which uses high-strength threads in the body of the boot, again providing strength without excessive weight.

Before Cristiano Ronaldo coorperate with Nike, Nike has build business with Messi. After the strive of Cristiano Ronldo become a new nova in football game. Nike choose C Lo to speaksprison of Nike Soccer Shoes. This is the first time C Lo achieve of his dream. In an interview Nike Free Run Femme SoccerBible.com, Cristiano Ronaldo explained his love for his Nike football boots: "Since I was 16 or 17, I've always played with the Mercurial. These boots are very different to others – they're much lighter, but I think the boots are perfect to play in. It is something very special to play with these boots because they are known for being fast" (2nd March 2009).


dongdong32



Joined: 23/03/2015 20:42:29
Messages: 65
Offline

20150324wengdongdong
chanel uk
louis vuitton
coach outlet online
cheap jerseys
michael kors outlet
ugg outlet
michael kors outlet
cheap jerseys
michael kors
hollister kids
louis vuitton outlet online
christian louboutin sale
canada goose outlet
jordan retro
coach outlet stores
coach factory
abercrombie
jordan 3s
mont blanc legend
michael kors outlet
cheap jerseys
mont blanc
ray ban sunglasses outlet
cheap ray bans
cheap oakley sunglasses
coach outlet store online
michael kors outlet online
coach factory online
black timberland boots
louis vuitton handbags
hollister clothing store
fitflops clearance
www.louisvuitton.com
michael kors outlet online
burberry outlet
coach factory outlet
uggs outlet
burberry outlet
uggs on sale
ray ban aviator
michael kors outlet online sale
timberland boots
michael kors uk
ugg outlet
jordan 4s
burberry outlet
louis vuitton outlet
jeremy scott adidas
ugg outlet
kate spade
burberry bags
coach outlet
ray ban eyeglasses
tory burch outlet
cheap uggs
ferragamo outlet
cheap nfl jerseys
michael kors purses
copy watches
louis vuitton outlet
gucci outlet
coach factory outlet
christian louboutin shoes
coach factorty outlet
prada shoes
burberry outlet online
michael kors outlet online
coach factory outlet
true religion jeans
michael kors outlet
michael kors bags
oakley sunglases
chanel outlet
abercrombie kids
true religion
coach factory outlet
true religion
cheap jerseys
michael kors handbags
coach outlet
coach factory
michael kors canada
christian louboutin outlet
oakley sunglasses cheap
michael kors uk
coach outlet store online
louis vuitton handbags
timberland earthkeepers
michael kors outlet online
louis vuitton outlet
oakley sunglasses
oakley sunglasses
louis vuitton
ralph lauren uk
celine outlet
jordan 3
true religion
ugg boots
michael kors outlet online
christian louboutin
toms outlet
fendi outlet
toms shoes
ugg outlet
ray ban sunglasses
christian louboutin
michael kors outlet
hollister clothing
marc jacobs
chanel outlet
christian louboutin
toms outlet
louis vuitton outlet
louis vuitton outlet
louis vuitton
coach outlet
hollister
christian louboutin
michael kors watches
michael kors outlet
louis vuitton uk
hollister
beats by dr dre
michael kors outlet online
concords 11
coach factory outlet
ray ban sunglasses
burberry outlet
oakley sunglasses
ralph lauren polo shirts
coach outlet
uggs outlet
celine
toms outlet
louis vuitton purses
ray ban outlet
michael kors
hollister clothing
abercrombie
louis vuitton handbags
tory burch outlet online
hollister co
football jerseys
coach factory
canada goose
dior handbags
michael kors outlet online sale
fitflops
abercrombie fitch
jeremy scott shoes
ray ban sunglasses sale
burberry outlet online
kate spade outlet
louis vuitton handbags
coach factory online
burberry outlet
ralph lauren sale
kate spade outlet
coach canada outlet
ugg boots
burberry outlet
ray ban glasses
oakley sunglasses outlet
michael kors purse
oakley sunglasses wholesale
lebron james shoes 2015
abercrombie
ray ban canada
michael kors
michael kors
coach factory outlet
ray bans
michael kors
coach factorty outlet
ray ban sunglasses uk
ray ban aviators
nike air max
michael kors outlet online
michael kors
cheap nfl jerseys
michael kors handbags
ugg boots
polo ralph lauren home
ferragamo belt
abercrombie & fitch
coach factory outlet
michael kors
tods shoes
coach factory outlet online
hogan shoes
mont blanc
uggs on sale
coach factory outlet
burberry outlet
louis vuitton outlet
north face outlet
ray ban outlet
coach outlet store online
abercrombie store
ugg boots
michael kors outlet
hollister
beats by dre
michael kors handbags
adidas shoes
polo ralph lauren
ralph lauren outlet
michael kors bag
louis vuitton
canada goose outlet
nike roshe run
louis vuitton handbags
michael kors uk
kids uggs on sale
gucci uk
oakley sunglasses
michael kors uk
true religion outlet
louis vuitton
mulberry uk
beats solo
coach outlet
belstaff
canada goose outlet
abercrombie
michael kors
chi flat iron
michael kors
jordan shoes
coach outlet store online
michael kors outlet
ugg australia
jordan 11 concord
mont blanc pens
louis vuitton outlet
michael kors outlet online
michael kors uk
coach outlet store online
michael kors outlet online
ray ban sunglasses
coco chanel
michael kors outlet online
jordan 6 cigar
ray ban glasses
moncler jackets
michael kors outlet
moncler outlet
michael kors
canada goose jackets
lebron james shoes
timberland boots
michael kors outlet
jordan 13
yoga pants
tory burch outlet
retro jordans
kate spade outlet
hollister outlet
uggs outlet
louis vuitton handbags
ray ban clubmaster
michael kors handbags
oakley sunglasses outlet
michael kors handbags
insanity workout
oakley sunglass
jordan shoes
beats by dr dre
michael kors uk
uggs outlet
coach outlet store online
cheap versace
the north face
louis vuitton outlet
kate spade handbags
jordan 11
canada goose jackets
p90x workouts
www.louisvuitton.com
polo ralph lauren
coach factory outlet
toms outlet
replica watches
lebron james shoes
coach factory outlet online
michael kors
polo ralph lauren
louis vuitton handbags
louis vuitton outlet
ugg boots sale
jordan 11 gamma blue
michael kors outlet
moncler jackets
ralph lauren
michael kors outlet
jordan 4
oakley sunglasses outlet
christian louboutin
oakley sunglasses wholesale
abercrombie store
coach factory
canada goose
tory burch outlet
tory burch outlet online
burberry outlet online
coach outlet store online
kate spade handbags
canada goose jackets
louis vuitton
michael kors watches
ugg boots
coach factory
abercrombie outlet
christian louboutin outlet
hermes birkin
christian louboutin outlet
coach factory online
michael kors outlet
oakley galsses
tod's shoes
kevin durant shoes
louis vuitton handbags
ray ban sunglasses
michael kors canada
coach outlet
rolex watches outlet
pandora charms
ray ban wayfarer
ray ban sunglasses uk
christian louboutin sale
jrodan retro
michael kors outlet online
ugg slippers
abercrombie
louis vuitton outlet
ugg boots sale
coach factory outlet online
louis vuitton handbags
fitflops outlet
ray ban sunglasses
chanel handbags
christian louboutin outlet
cheap uggs
celine outlet
red christian louboutin
hollister clothing store
cheap jordans
ugg boots
louis vuitton
ugg boots
black timberland boots
uggs sale
ralph lauren outlet
celine
hollister
oakley vault
coach factory outlet online
abercrombie and fitch
canada goose jackets
oakley sunglasses cheap
louis vuitton
louis vuitton handbags
coach outlet store online
mont blanc
canada goose outlet
coach outlet
toms shoes
louis vuitton outlet
cheap toms
jordan 13
canada goose
coach outlet
pandara jewelry
tory burch outlet
chanel handbags
tory burch shoes
louis vuitton outlet stores
ralph lauren
oakley sunglass
michael kors handbags
michael kors
louis vuitton outlet
louis vuitton
gucci outlet
uggs on sale
jordan 6
ugg boots outlet
cheap jordans
coach outlet
jordan 8s
michael kors outlet online
michael kors watches
jordan 8
coach purses
louis vuitton outlet
adidas outlet
louis vuitton handbags
gucci shoes
michael kors canada
coach outlet
ugg boots on sale
prada outlet
oakley vault
jordan 11 low
ray ban outlet
michael kors outlet online
michael kors handbags
christian louboutin
ugg boots
mulberry outlet
true religion jeans
tory burch outlet online
jordan 11
gucci outlet
ugg australia
kobe bryant shoes
gucci uk
canada goose outlet
mulberry handbags
michael kors outlet online
uggs on sale
red heels
jordan 11s
chanel handbags
oakley sunglasses
michael kors outlet
canada goose
ray ban glasses
canada goose jackets
coach outlet
chanel handbags
oakley sunglasses wholesale
air jordan 11
louis vuitton
jordan 4
timberland boots
canada goose jackets
prescription sunglasses
michael kors
coach outlet
michael kors outlet
coach outlet
belstaff jackets
retro jordans
burberry outlet online
louis vuitton
soccer jerseys
juicy couture
uggs outlet
abercrombie & fitch
nike air max 90
coach factory store online
christian louboutin shoes
michael kors outlet online
uggs outlet
abercrombie and fitch new york
jordan concords
michael kors watches
marc by marc jacobs
burberry scarf
coach outlet
christian louboutin sale
cheap uggs
michael kors watches
oakley sunglasses
louis vuitton handbags
christian louboutin sale
nike outlet
supra shoes
ugg outlet
ugg australia
oakley sunglasses outlet
coach outlet
jordan 11 low
air max 2015
kors outlet
michael kors handbags
kobe shoes
ghd hair strighteners
true religion jeans
abercrombie
abercrombie
michael kors outlet online sale
louis vuitton handbags
fitflop shoes
coach outlet store online
fitflops
true religion
cheap jordans
coach outlet store online
kate spade
christian louboutin
abercrombie
jordan 13
tod's shoes
hollister clothing
louis vuitton outlet
louis vuitton outlet stores
tory burch sale
prada uk
ray ban uk
cheap lululemon
coach factory outlet
cheap nfl jerseys
ugg outlet
hollister clothing
ray ban sunglasses
michael kors uk
burberry handbags
tory burch
lebron james basketball shoes
coach outlet store online
replica watches
nike shoes
canada goose
ray ban sunglasses
ugg outlet
ray ban sunglasses
michael kors outlet
gucci
micahel kors outlet
oakley sunglasses wholesale
oakley sunglasses
louis vuitton handbags
marc jacobs
ray bans
gucci handbags
chanel bags
burberry scarf
ray ban watyfarer
ugg australia
burberry outlet
gucci outlet
gucci outlet
lululemon
coach handbags
michael kors outlet online
christian louboutin
michael kors handbags
mont blanc pens
air jordan 13
tods outlet
gucci shoes
oakley sunglasses sale
fitflop footwear
jordan 11 gamma blue
cheap jordans
coach factory outlet
christian louboutin outlet
michael kors
louis vuitton
moncler
ray ban sunglass
ugg boots
michael kors bag
ugg sale
coach factory outlet
louis vuitton
michael kors handbags
michael kors outlet
jordan 11s
uggs outlet
ugg boots
timberlands
ugg outlet
michael kors outlet
cheap louis vuitton handbags
 
Forum Index » Introduction
Go to:   
Powered by JForum 2.1.8 © JForum Team