----- Original Message -----
> From: "Tomas Jelinek" <[email protected]>
> To: "Vojtech Szocs" <[email protected]>
> Cc: "devel" <[email protected]>
> Sent: Thursday, December 15, 2016 8:27:10 AM
> Subject: Re: [ovirt-devel] Using SLF4J in frontend code
> 
> On Wed, Dec 14, 2016 at 5:27 PM, Vojtech Szocs <[email protected]> wrote:
> 
> > Hi,
> >
> > I was looking into "why" we need to emulate SLF4J classes for usage
> > in GWT frontend (given that one should use java.util.logging instead):
> >
> >   frontend/webadmin/modules/gwt-extension/src/main/java/org/
> > ovirt/engine/ui/uioverrides/org/slf4j/Logger.java
> >   frontend/webadmin/modules/gwt-extension/src/main/java/org/
> > ovirt/engine/ui/uioverrides/org/slf4j/LoggerFactory.java
> >
> > I found two frontend-specific classes, which I fixed. However, I could
> > not remove ^^ SLF4J class overrides, because some shared (backend) code
> > still uses SLF4J, in particular:
> >
> >   VmRngDevice.java => backend, common module
> >   EnumValueAutoCompleter.java => backend, searchbackend module
> >   SyntaxChecker.java => backend, searchbackend module
> >
> > 1, should a backend business entity (VmRngDevice) perform logging?
> >
> 
> Well, VmRngDevice has some data and has some logic. And since it has logic,
> I think it should also be allowed to
> do some logging.
> 
> I honestly don't have issues with entities to have some degree of logic,
> the problem is that they are sent to FE.

If we adhere to existing backend design, all business logic should
be isolated into dedicated commands. This implies leaving entities
void of actual business logic.

But VmRngDevice#csvToSourcesSet isn't really business logic, it's
just a utility to parse String into Set<Source>. Just wondering why
are we suppressing IllegalArgumentException (parse errors) there.

> But this is an old decision and we need to live with it (for now). That
> particular log statement looks quite useful to me and I
> would not remove it.

The thing is, VmRngDevice#csvToSourcesSet is only called on backend,
but since we tell GWT compiler that all business entity code is live
(via DontPrune aspect), we still need to emulate SLF4J logging API..

> 
> 
> > 2, assuming "searchbackend" functionality is exposed only via the GWT
> >    frontend, why it's represented as a backend module?
> >
> > Thanks,
> > Vojtech
> > _______________________________________________
> > Devel mailing list
> > [email protected]
> > http://lists.phx.ovirt.org/mailman/listinfo/devel
> >
> 
_______________________________________________
Devel mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/devel

Reply via email to