Hubert Grzeskowiak

Greenhorn
+ Follow
since Nov 11, 2014
Hubert likes ...
Python Java Linux
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
1
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Hubert Grzeskowiak

Hi Junilu,
and thanks for your input. I really like your approach of naming tests after the methods' public API. I wasn't aware there was a "JUnit 4 naming convention". According to https://dzone.com/articles/7-popular-unit-test-naming there's many conventions, which is why I stick to the conventions used at my company. I think consistency is more important here.
3 years ago
Spooky greetings to ya'all!

In my application I have quite a few service classes that act as a facade and delegate most calls to one or more underlying manager classes. I've read very different opinions on how to test such facades. Some people say it's not necessary to test them at all, others say one should test whether the integration is working. I've implemented two test methods for the delegating method below. One test is checking whether the underlying manager method has been called exactly once, the other test checks whether the passed data is equal (or in this case: the same).




I'd love to hear opinions from experienced devs whether testing such methods makes sense and if it does, which method of testing is better.

Thanks and cheers
Hugo
3 years ago
Wow, thanks! Didn't expect that from my rather generic questions :-)
3 years ago
Hi Ric and thanks for the reply,

unfortunately not the answer I hoped for. SecurityFocus seems very generic and wide-scoped. The filtering of the mailing lists would take too much time to be of use for developers. A customizable, stack-centric security news site seems to be a new business opportunity :-)

Cheers
Hugo
3 years ago
We don't have a culture of article sharing, but we do have meetings for knowledge exchange and the management is easy to approach. I'll try it that way then. Thanks for the hints
3 years ago
Hi there,

there are many exploit listings and security advisory boards on the web, but I can't find any that focuses on the particular technologies my company is using. Is there such thing as customizable security news? For example, I'm maintaining a web app that is using Payara Java app-server and typical Java EE technology (JPA, JSF and so on). A collegue might be using only PHP and AngularJS. How can we stay up to date regarding security without either crawling through every used library's news or traversing through generic security news?

Thanks
Hugo
3 years ago
Hi there,

given a mid-sized company that generates all revenue from online services, which has no known security problems, how to raise the awareness of IT security? I'm pretty sure we're having deficits and I'd like to prove that, but I don't want to put the company at any risk doing so. I'm a DevOps engineer and developer, but have no experience in anything security related. How can I improve the security and raise the awareness without investing too much.

Thanks
Hugo
3 years ago

Junilu Lacar wrote:

in "Clean Code," Robert Martin wrote:
It is sometimes reasonable to leave “To do” notes in the form of //TODO comments. ... Still, you don’t want your code to be littered with TODOs. So scan through them regularly and eliminate the ones you can.


Hmm... either you've misunderstood what he wrote (emphasis mine) or you're referring to some other passage in the book.


Hi and thanks your your answer. This is the passage I meant. Martin first writes about occasional reasonability, but the rest of the passage you quoted gives me a strong impression of him being opposed to any TODOs. Hence my question whether this is opinion or consensus, and how to deal with TODOs.
3 years ago
Hello fellow coding monkeys,

I read recently in Clean Code by Robert C. Martin, that comments starting with TODO or FIXME in code are considered harmful. Is that a consensus or just this particular author's opinion?
I am personally using TODOs to mark code that I want to change at a later point. Of course, I always change the focus of my work at some point and the TODO stays in for longer times. Some people are therefore suggesting adding the own name and a date to the TODOs, or, like Martin, getting rid of the TODOs entirely.
Since most TODOs are addressed at the author himself in the future, I was wondering if it wouldn't be better to have these comments locally only. Imagine an IDE plugin that excludes all new lines starting with TODO from commits. This way you would still see them later on, but your collegues would have less shitty code to work with.

What do you think about the idea?
3 years ago
Hi,
I'm not as experienced as Tim, but I'd like to add my two cents since I disagree with some of the suggestions in this thread.

On the one side, JSF's VTL has the advantages of simple nesting and easy to use, rich component libraries. As XML it's also validate-able. This is as far as the pros go.

On the other side, there are many disadvantages: the learning curve is extremely steep, as new developers need to not only know XHTML, XML and the used components, possibly extended by PrimeFaces or RichFaces. They also need to learn your company's custom components and at least some of the converters, filters and backing beans. This is a huge drawback for people used to HTML or simple templating languages. This is also the point at which I disagree with Tim on preferring JSF elements over plain HTML. For HTML you easily find many good web devs and designers. These people are punished for their skills, as JSF's VTL misses to re-use their knowledge. You see that in a different handling of IDs (JSF concatenates IDs of some(!) parents and children), the use of a "class" attribute, which is not to be confused with "styleClass", and many other things like that.
Many times, when starting a new project, you get a static page in HTML from a designer which you need to make dynamic for a project. In such cases it doesn't make any sense to replace the all the well-known (by people and browsers), semantically richer and most probably shorter HTML code with JSF XHTML unless necessary.

As for the argument with PDF generation: the conversion of XHTML to PDF never really worked well and almost nobody ever used it. Why would you invest time and money in making your pages multi-format capable if that will most probably never be of use?

Just my two cents.
Hubert Grzeskowiak
4 years ago
JSF
Hi Tim and thanks for the answer,
navigating or showing different content based on backing beans is an anti-pattern IMHO. I know JSF is a resource and component based framework, but that doesn't mean we have to ignore the request incl. URL entirely. Bookmarkable URLs and the ability of page refreshing are basic essentials for SEO and UX. I found out this misguided JSF philosophy somewhat too late, and I guess I'll be rather using request based frameworks like Spring MVC for new projects when possible.
4 years ago
JSF
Current status:



I don't like the fact I have a part of the URL in the link. When I change the path of the file one day all links are broken.
4 years ago
JSF
Hi,

so far I'm only showing lists of items. Now I have created a detail page which should show one particular entity. The detail page has a view param that is the name of the entity. The URL is something like .../detail/application.xhtml?name=FooBar It all works so far.

Now I'm wondering whether I'll have to generate that URL by hand every time I want to use it or does JSF give me any shortcut? In Django (Python) for example, you name your views and the URL is generated for you based on the view name.

Thanks in advance
Hugo
4 years ago
JSF
Cool. Thanks! This will definately come in handy. :-)
Hi and thanks for the reply,

Multiple rows have the maximum value for salary, so how can the DBMS know which value to return.


- In my case any of the entries would be okay. I'd expect the database to simply return the first one it finds.


And your example query is illegal in standard SQL


This is really good to know! I didn't know this was MySQL specific.

If you didn't have to take the employment status into account


Unfortunately this is part of the core business logic. In my actual use case I'm dealing with system emergencies and an enum is used to represent the status (e.g. OPEN, FIXED), so when showing active emergencies I don't want to show outdated ones.

After some more searching I found that StackOverflow actually has a tag specially for this problem: http://stackoverflow.com/questions/tagged/greatest-n-per-group
Some of the best rated answers are very similar to yours :-)