Which way is better to create a saml object?

Yaowen Tu yaowen.tu at gmail.com
Fri Aug 3 21:19:21 EDT 2012


Hi,

I am looking at some examples, and seeing two different ways of creating
SAML object. I want to know which is better?

One:

XMLObjectBuilderFactory builderFactory =
org.opensaml.Configuration.getBuilderFactory();
AuthnRequestBuilder arb = (AuthnRequestBuilder) builderFactory.getBuilder(
AuthnRequest.DEFAULT_ELEMENT_NAME );
AuthnRequest auth = (AuthnRequest) arb.buildObject();


Another:

AuthnRequest arb = (new AuthnRequestBuilder()).buildObject();

One is using factory to get the builder, and the other is just create a new
builder. I am not sure about the implementation. So I want to know which is
better?

Is the first one faster? Do we recommend using the second one?


Thanks,
Yaowen
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://shibboleth.net/pipermail/dev/attachments/20120803/ac718a87/attachment.html 


More information about the dev mailing list