Seam 3: webbeans-logging/webbeans-logger

View: New views
7 Messages — Rating Filter:   Alert me  

Seam 3: webbeans-logging/webbeans-logger

by petemuir :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

You should probably depend on webbeans-logger, not webbeans-logging (-
logging simply provides the logging core, so that the RI can depend on  
it, -logger is the portable module).
_______________________________________________
seam-dev mailing list
seam-dev@...
https://lists.jboss.org/mailman/listinfo/seam-dev

Re: Seam 3: webbeans-logging/webbeans-logger

by Dan Allen (mojavelinux) :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Fri, May 29, 2009 at 7:28 AM, Pete Muir <pmuir@...> wrote:
You should probably depend on webbeans-logger, not webbeans-logging (-logging simply provides the logging core, so that the RI can depend on it, -logger is the portable module).

I was wondering about that! Okay, I will switch over. I saw Shane using webbeans-logging so I just started doing the same. I should have asked earlier.

-Dan

--
Dan Allen
Senior Software Engineer, Red Hat | Author of Seam in Action

http://mojavelinux.com
http://mojavelinux.com/seaminaction
http://in.relation.to/Bloggers/Dan

NOTE: While I make a strong effort to keep up with my email on a daily
basis, personal or other work matters can sometimes keep me away
from my email. If you contact me, but don't hear back for more than a week,
it is very likely that I am excessively backlogged or the message was
caught in the spam filters.  Please don't hesitate to resend a message if
you feel that it did not reach my attention.

_______________________________________________
seam-dev mailing list
seam-dev@...
https://lists.jboss.org/mailman/listinfo/seam-dev

Re: Seam 3: webbeans-logging/webbeans-logger

by petemuir :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Yeah, the split is un-obvious (esp due to naming), but we wanted a module we could use inside the RI, that didn't have the producer method on it....

There should be a note on this in WB ref guide, if it is missing, we need to add it.

On 29 May 2009, at 14:51, Dan Allen wrote:

On Fri, May 29, 2009 at 7:28 AM, Pete Muir <pmuir@...> wrote:
You should probably depend on webbeans-logger, not webbeans-logging (-logging simply provides the logging core, so that the RI can depend on it, -logger is the portable module).

I was wondering about that! Okay, I will switch over. I saw Shane using webbeans-logging so I just started doing the same. I should have asked earlier.

-Dan

--
Dan Allen
Senior Software Engineer, Red Hat | Author of Seam in Action

http://mojavelinux.com
http://mojavelinux.com/seaminaction
http://in.relation.to/Bloggers/Dan

NOTE: While I make a strong effort to keep up with my email on a daily
basis, personal or other work matters can sometimes keep me away
from my email. If you contact me, but don't hear back for more than a week,
it is very likely that I am excessively backlogged or the message was
caught in the spam filters.  Please don't hesitate to resend a message if
you feel that it did not reach my attention.


_______________________________________________
seam-dev mailing list
seam-dev@...
https://lists.jboss.org/mailman/listinfo/seam-dev

Re: Seam 3: webbeans-logging/webbeans-logger

by Dan Allen (mojavelinux) :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Fri, May 29, 2009 at 10:00 AM, Pete Muir <pmuir@...> wrote:
Yeah, the split is un-obvious (esp due to naming), but we wanted a module we could use inside the RI, that didn't have the producer method on it....

So I'm wondering, what should the standard signature of this injection be? Always a field injection (as opposed to a constructor injection)? What about access (package or private)?

private @Logger Log log;

The reason I ask about access (and constructor injection) is because this could be the one pain in the side to unit testing a bean. Package access just makes it easier to inject a stub. What would be interesting is if the field could be seeded with a stub so that the logger just works in a unit test.

private @Logger Log log = new NoOpLogImpl();

The injection would overwrite this value. Just an idea.

-Dan

--
Dan Allen
Senior Software Engineer, Red Hat | Author of Seam in Action

http://mojavelinux.com
http://mojavelinux.com/seaminaction
http://in.relation.to/Bloggers/Dan

NOTE: While I make a strong effort to keep up with my email on a daily
basis, personal or other work matters can sometimes keep me away
from my email. If you contact me, but don't hear back for more than a week,
it is very likely that I am excessively backlogged or the message was
caught in the spam filters.  Please don't hesitate to resend a message if
you feel that it did not reach my attention.

_______________________________________________
seam-dev mailing list
seam-dev@...
https://lists.jboss.org/mailman/listinfo/seam-dev

Re: Seam 3: webbeans-logging/webbeans-logger

by petemuir :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

What sort of unit test are you thinking of? The unit tests we do in Web Beans and the TCK run WB, so cause the injection to occur (do we need to provide a mock logger?!) - I though you used a similar thing in Seam...

On 29 May 2009, at 18:12, Dan Allen wrote:

On Fri, May 29, 2009 at 10:00 AM, Pete Muir <pmuir@...> wrote:
Yeah, the split is un-obvious (esp due to naming), but we wanted a module we could use inside the RI, that didn't have the producer method on it....

So I'm wondering, what should the standard signature of this injection be? Always a field injection (as opposed to a constructor injection)? What about access (package or private)?

private @Logger Log log;

The reason I ask about access (and constructor injection) is because this could be the one pain in the side to unit testing a bean. Package access just makes it easier to inject a stub. What would be interesting is if the field could be seeded with a stub so that the logger just works in a unit test.

private @Logger Log log = new NoOpLogImpl();

The injection would overwrite this value. Just an idea.

-Dan

--
Dan Allen
Senior Software Engineer, Red Hat | Author of Seam in Action

http://mojavelinux.com
http://mojavelinux.com/seaminaction
http://in.relation.to/Bloggers/Dan

NOTE: While I make a strong effort to keep up with my email on a daily
basis, personal or other work matters can sometimes keep me away
from my email. If you contact me, but don't hear back for more than a week,
it is very likely that I am excessively backlogged or the message was
caught in the spam filters.  Please don't hesitate to resend a message if
you feel that it did not reach my attention.
_______________________________________________
seam-dev mailing list
seam-dev@...
https://lists.jboss.org/mailman/listinfo/seam-dev


_______________________________________________
seam-dev mailing list
seam-dev@...
https://lists.jboss.org/mailman/listinfo/seam-dev

Re: Seam 3: webbeans-logging/webbeans-logger

by Dan Allen (mojavelinux) :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Mon, Jun 1, 2009 at 6:14 AM, Pete Muir <pmuir@...> wrote:
What sort of unit test are you thinking of? The unit tests we do in Web Beans and the TCK run WB, so cause the injection to occur (do we need to provide a mock logger?!) - I though you used a similar thing in Seam...

It depends on how you define unit testing (or two what degree for a given test). The holy grail of POJO development is that you can inject all dependencies manually in the test setup, if you want. The more things a class depends on, the more things you have to inject. Now, it makes perfect since to have to inject dependencies that the class depends on to perform the business function. But having to worry about injecting a logger just to get the class to work seems like...well, sort of a bummer. I would prefer that if I'm in a manual test setup configuration (outside of any bootstrap) then I don't have to worry about injecting a logger.

Perhaps I'm just being too purist. But I still say that I should not care, as a tester, that a class needs a logger. It should find one itself if I don't provide it one.

Of course, with the AbstractWebBeansTestCase, a logger will be injected. I get that.

-Dan

 

On 29 May 2009, at 18:12, Dan Allen wrote:

On Fri, May 29, 2009 at 10:00 AM, Pete Muir <pmuir@...> wrote:
Yeah, the split is un-obvious (esp due to naming), but we wanted a module we could use inside the RI, that didn't have the producer method on it....

So I'm wondering, what should the standard signature of this injection be? Always a field injection (as opposed to a constructor injection)? What about access (package or private)?

private @Logger Log log;

The reason I ask about access (and constructor injection) is because this could be the one pain in the side to unit testing a bean. Package access just makes it easier to inject a stub. What would be interesting is if the field could be seeded with a stub so that the logger just works in a unit test.

private @Logger Log log = new NoOpLogImpl();

The injection would overwrite this value. Just an idea.

-Dan

--
Dan Allen
Senior Software Engineer, Red Hat | Author of Seam in Action

http://mojavelinux.com
http://mojavelinux.com/seaminaction
http://in.relation.to/Bloggers/Dan

NOTE: While I make a strong effort to keep up with my email on a daily
basis, personal or other work matters can sometimes keep me away
from my email. If you contact me, but don't hear back for more than a week,
it is very likely that I am excessively backlogged or the message was
caught in the spam filters.  Please don't hesitate to resend a message if
you feel that it did not reach my attention.
_______________________________________________
seam-dev mailing list
seam-dev@...
https://lists.jboss.org/mailman/listinfo/seam-dev




--
Dan Allen
Senior Software Engineer, Red Hat | Author of Seam in Action

http://mojavelinux.com
http://mojavelinux.com/seaminaction
http://in.relation.to/Bloggers/Dan

NOTE: While I make a strong effort to keep up with my email on a daily
basis, personal or other work matters can sometimes keep me away
from my email. If you contact me, but don't hear back for more than a week,
it is very likely that I am excessively backlogged or the message was
caught in the spam filters.  Please don't hesitate to resend a message if
you feel that it did not reach my attention.

_______________________________________________
seam-dev mailing list
seam-dev@...
https://lists.jboss.org/mailman/listinfo/seam-dev

Re: Seam 3: webbeans-logging/webbeans-logger

by petemuir :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I think the idea with JCDI is that you do your unit tests in the  
container (hence things like @Mock)...

On 13 Jun 2009, at 02:16, Dan Allen wrote:

> On Mon, Jun 1, 2009 at 6:14 AM, Pete Muir <pmuir@...>  
> wrote:
> What sort of unit test are you thinking of? The unit tests we do in  
> Web Beans and the TCK run WB, so cause the injection to occur (do we  
> need to provide a mock logger?!) - I though you used a similar thing  
> in Seam...
>
> It depends on how you define unit testing (or two what degree for a  
> given test). The holy grail of POJO development is that you can  
> inject all dependencies manually in the test setup, if you want. The  
> more things a class depends on, the more things you have to inject.  
> Now, it makes perfect since to have to inject dependencies that the  
> class depends on to perform the business function. But having to  
> worry about injecting a logger just to get the class to work seems  
> like...well, sort of a bummer. I would prefer that if I'm in a  
> manual test setup configuration (outside of any bootstrap) then I  
> don't have to worry about injecting a logger.
>
> Perhaps I'm just being too purist. But I still say that I should not  
> care, as a tester, that a class needs a logger. It should find one  
> itself if I don't provide it one.
>
> Of course, with the AbstractWebBeansTestCase, a logger will be  
> injected. I get that.
>
> -Dan
>
>
>
> On 29 May 2009, at 18:12, Dan Allen wrote:
>
>> On Fri, May 29, 2009 at 10:00 AM, Pete Muir  
>> <pmuir@...> wrote:
>> Yeah, the split is un-obvious (esp due to naming), but we wanted a  
>> module we could use inside the RI, that didn't have the producer  
>> method on it....
>>
>> So I'm wondering, what should the standard signature of this  
>> injection be? Always a field injection (as opposed to a constructor  
>> injection)? What about access (package or private)?
>>
>> private @Logger Log log;
>>
>> The reason I ask about access (and constructor injection) is  
>> because this could be the one pain in the side to unit testing a  
>> bean. Package access just makes it easier to inject a stub. What  
>> would be interesting is if the field could be seeded with a stub so  
>> that the logger just works in a unit test.
>>
>> private @Logger Log log = new NoOpLogImpl();
>>
>> The injection would overwrite this value. Just an idea.
>>
>> -Dan
>>
>> --
>> Dan Allen
>> Senior Software Engineer, Red Hat | Author of Seam in Action
>>
>> http://mojavelinux.com
>> http://mojavelinux.com/seaminaction
>> http://in.relation.to/Bloggers/Dan
>>
>> NOTE: While I make a strong effort to keep up with my email on a  
>> daily
>> basis, personal or other work matters can sometimes keep me away
>> from my email. If you contact me, but don't hear back for more than  
>> a week,
>> it is very likely that I am excessively backlogged or the message was
>> caught in the spam filters.  Please don't hesitate to resend a  
>> message if
>> you feel that it did not reach my attention.
>> _______________________________________________
>> seam-dev mailing list
>> seam-dev@...
>> https://lists.jboss.org/mailman/listinfo/seam-dev
>
>
>
>
> --
> Dan Allen
> Senior Software Engineer, Red Hat | Author of Seam in Action
>
> http://mojavelinux.com
> http://mojavelinux.com/seaminaction
> http://in.relation.to/Bloggers/Dan
>
> NOTE: While I make a strong effort to keep up with my email on a daily
> basis, personal or other work matters can sometimes keep me away
> from my email. If you contact me, but don't hear back for more than  
> a week,
> it is very likely that I am excessively backlogged or the message was
> caught in the spam filters.  Please don't hesitate to resend a  
> message if
> you feel that it did not reach my attention.

_______________________________________________
seam-dev mailing list
seam-dev@...
https://lists.jboss.org/mailman/listinfo/seam-dev