Re: [seam-dev] [weld-dev] Replacing pages.xml
by Lincoln Baxter, III
Copying seam-dev because this seems very relevant ;)
--
A pitfall with the class/annotations configuration: the potential loss of
ability for runtime modification during development. Being able to change
configuration while the server is running, seeing your changes immediately,
is a huge benefit for productivity.
I don't know if Seam2 provided runtime config reloading, but I would
hesitate use a Java-based option. There are places where XML is useful, as
long as it is kept simple. In my opinion, we need to be really careful when
applying annotations/single objects to concepts with which they do not
directly align, or "fit," in a one-to-one manner.
The enumeration concept is interesting because, unlike classes, enums do not
claim to be anything more than "a representation of a set of concepts and
some standard behaviors."
public enum MyAppPage implements Page<MyAppPage> {
@View(.....)
login {
@Inject Login loginBean;
public MyAppPage next(MyAppPage page, Object outcome) {
if ( loginBean.isLoggedIn() )
return main;
else
return login;
}
}
}
This forces all navigation logic from a specific view into one Enum
definition, which is nicely centralized; however, I'm not sure what the
intent is here: Is this a no-op navigation?
@View(.....)
main {
public MyAppPage next(MyAppPage page, Object outcome) {
return main;
}
},
@View(.....)
logout {
public MyAppPage next(MyAppPage page, Object outcome) {
return login;
}
};
Also, how will this address the bookmarkability issue? How are parameters
passed between pages? -- Pages.xml used explicit syntax for parameter
passing:
<param name="documentId" value="#{documentEditor.documentId}"/>
Which would be difficult to translate into an Enum solution like the one
that Gavin suggested. I'm not seeing an immediate solution, save adding an
additional method that returns a list of parameter names and expressions to
be propagated, but now we're talking about a lot of boilerplate code in
order to do something simple.
I'm probably going to lite a fire by saying this, but sometimes XML is more
concise than Java. I'd like to be convinced that this is a good option to
provide, and that it will be simpler or more usable than XML. Right now my
gut is telling me that it's going to be more complicated both for our
development, and the users'.
I am a big fan of the Injectability, and I think that's a strong point
toward a native Java solution, but I'm not sure it's enough when you can
already reference beans through EL in pages.xml and get direct access to
both contexts and dependencies - giving you the best of both worlds in a
pretty reusable way.
Thoughts?
Lincoln
On Fri, Feb 19, 2010 at 4:03 PM, Marcell Manfrin Barbacena <
barbacena(a)gmail.com> wrote:
> I posted this sometime ago and I think it relates to this then I am
> re-posting:
>
> --
> One of the things I would like to have is something like a plugable
> application module with JSF as in:
>
> http://wicketinaction.com/2008/10/creating-pluggable-applications-with-wi...
>
> However if we stick with wicket to get the view part modularity the
> only thing necessary to have is a way to retreive all avaliable beans
> with a given Steriotype or Qualifier (the spring way is
> BeanFactoryUtils.beansOfTypeIncludingAncestors)
> --
>
> I think doing this pages configuration in java we could do the same
> feature with jsf. (But we would also need a bit more)
>
> []s
>
> ===
> "Our deepest fear is not that we are inadequate.
> Our deepest fear is that we are powerful beyond measure.
> It is our light, not our darkness that most frightens us.
> Your playing small does not serve the world.
> There is nothing enlightened about shrinking so that other people
> won't feel insecure around you.
> We are all meant to shine.
> And as we let our own light shine, we unconsciously give other people
> permission to do the same.
> As we are liberated from our own fear, our presence automatically
> liberates others."
> by Marianne Williamson
> --
> Marcell Manfrin Barbacena
> barbacena(a)gmail.com
> marcell(a)tre-pb.gov.br
> Skype: callto://marcell84bruk
> +55 (83) 8808-8555 (Mobile)
> +55 (83) 3224-5945 (Home)
>
>
>
> On Fri, Feb 19, 2010 at 5:51 PM, Arbi Sookazian <asookazian(a)gmail.com>
> wrote:
> > Seam has a relatively small number of (mostly static) xml config files
> > (thank God). I'm not sure it's even necessary to convert the pages.xml
> to a
> > class or even if all users would want that. Yes, type safety is good,
> but
> > it's easier to read in xml format sometimes. If you leave the option of
> > class or xml then it's ok.
> >
> > Is the Page class/enum going to be something that is extended or
> > polymorphic, etc? Why convert to OO if the only reason is type-safety
> > assurance in this case (plz don't beat this comment down, yes, maybe I'm
> > missing something).
> >
> > It would be pretty cool if there was a new utility that converted a
> > pages.xml to class/OO format...
> >
> > On Fri, Feb 19, 2010 at 12:35 PM, Stuart Douglas
> > <stuart(a)baileyroberts.com.au> wrote:
> >>
> >> find . | grep xhtml | wc
> >> 392 392 21192
> >>
> >> It's going to be a big enum... we would need to make sure that you could
> >> split it up.
> >>
> >> The only real problem I have with this approach is that all the metadata
> >> that is availible is hard coded into the page class, which means the
> page
> >> class has to know about every module that wants to use page level
> metadata.
> >> Also, you can't really configure it via xml, which I am not too worried
> >> about but may alienate some users.
> >>
> >> Stuart
> >>
> >> On 19/02/2010, at 4:40 PM, Gavin King wrote:
> >>
> >> > You should even be able to make this work:
> >> >
> >> > @View(.....)
> >> > login {
> >> > @Inject Login loginBean;
> >> > public MyAppPage next(MyAppPage page, Object outcome) {
> >> > if ( loginBean.isLoggedIn() )
> >> > return main;
> >> > else
> >> > return login;
> >> > }
> >> > },
> >> >
> >> > of course we would need a little infrastructure for injecting into
> enum
> >> > values.
> >> >
> >> > On Thu, Feb 18, 2010 at 11:37 PM, Gavin King <gavin.king(a)gmail.com>
> >> > wrote:
> >> >> Oops, this is a MUCH better way to write this code:
> >> >>
> >> >>
> >> >> public enum MyAppPage implements Page<MyAppPage> {
> >> >>
> >> >> @View(.....)
> >> >> login {
> >> >> public MyAppPage next(MyAppPage page, Object outcome) {
> >> >> if (Boolean.TRUE.equals(outcome))
> >> >> return main;
> >> >> else
> >> >> return login;
> >> >> }
> >> >> },
> >> >>
> >> >> @View(.....)
> >> >> main {
> >> >> public MyAppPage next(MyAppPage page, Object outcome) {
> >> >> return main;
> >> >> }
> >> >> },
> >> >>
> >> >> @View(.....)
> >> >> logout {
> >> >> public MyAppPage next(MyAppPage page, Object outcome) {
> >> >> return login;
> >> >> }
> >> >> };
> >> >>
> >> >> }
> >> >>
> >> >
> >> >
> >> >
> >> > --
> >> > Gavin King
> >> > gavin.king(a)gmail.com
> >> > http://in.relation.to/Bloggers/Gavin
> >> > http://hibernate.org
> >> > http://seamframework.org
> >>
> >>
> >> _______________________________________________
> >> weld-dev mailing list
> >> weld-dev(a)lists.jboss.org
> >> https://lists.jboss.org/mailman/listinfo/weld-dev
> >
> >
> > _______________________________________________
> > weld-dev mailing list
> > weld-dev(a)lists.jboss.org
> > https://lists.jboss.org/mailman/listinfo/weld-dev
> >
>
> _______________________________________________
> weld-dev mailing list
> weld-dev(a)lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/weld-dev
>
--
Lincoln Baxter, III
http://ocpsoft.com
http://scrumshark.com
"Keep it Simple"
14 years, 1 month
repeatedly save the same processInstance caused by seam
by Richard Qin
hi!
I'm tuning a web app based seam 2.2.0 and jBPM 3.2.5.sp5. The call tree of
CPU view in the jProfiler shows that the jbpmContext.save(ProcessInstance
processInstance) was called more than 2000 times in a jsf request. After
debugging the source code of app, seam, and jBPM, I found that each
event-scoped component initialization in a jsf request would cause the same
processInstance associated with the business process context to be added to
the autoSaveProcessInstances by jbpmContext.autoSaveProcessInstances method.
So in the end of a jsf request, each of the same processInstance in
the autoSaveProcessInstances would be repeatedly saved in the
jbpmContext.autoSave. How can i avoid to repeatedly save the same
processInstance? Any suggestion are greatly appreciated.
--
Richard Qin
JBoss Solution Architect
Red Hat Service Center, P.R.China
14 years, 1 month
Seam 2.2.1 CR1 testing results
by Ondřej Skutka
Hi!
Seam QE has finished testing Seam 2.2.1 CR1. Following issues were
found:
JBSEAM-4558 Seam-gen generates duplicate ids for table with composite
primary key
JBSEAM-4575 Seam Itext example doesn't work correctly (already fixed by
Marek)
JBSEAM-4561 testMultipleWindowSearch() stuck in Firefox
Issues regarding JBoss AS 6.x
JBSEAM-4563 Seambay example unable to commit transaction
JBSEAM-4562 Drools example throws RuntimeDroolsException on JBoss AS 6
JBSEAM-4565 Spring example unable to deploy to JBoss AS 6
JBSEAM-4566 seam-mail does not work on JBoss AS 6
JBSEAM-4567 Metawidget examples fail to deploy to JBoss AS 6 M2
JBSEAM-4568 Seam Nestedbooking example doesn't work correctly on JBossAS
6.0.0.M2
JBSEAM-4570 Seam Excel example doesn't work correctly on JBossAS
6.0.0.M2
Issues regarding JBoss AS 4.x
JBSEAM-4569 Blog example fails to deploy to JBoss AS 4.2.3
JBSEAM-4573 Infinite loop in Spring example on JBoss AS 4.2.3
JBSEAM-4560 Dvdstore example fails to deploy to JBoss AS 4.2.3
JBSEAM-4571 Hibernate example fails to deploy to JBoss AS 4.2.3
JBSEAM-4572 NameNotFoundException thrown at runtime in groovybooking
example
Thanks all for your effort,
Ondra
14 years, 1 month