Mvn modules, external factories, guava optionals strategy, logging tweeks, recursive collections, travis...

46 views
Skip to first unread message

Antony Stubbs

unread,
Nov 15, 2013, 9:59:17 PM11/15/13
to po...@googlegroups.com
Just wanted to post here the community, I took my company Knewton's hack day opportunity to improve Podam, and make it usable for our needs.

We use Guava Optional's a lot, and we didn't want to have to modify classes to be able to use Podam with them. So I added an external attribute handler hook, as well as making a seperate mvn module for the Guava factories we use. 

In the process discovered that recursive collections aren't handled, so improved things to fix that.

Also did a couple of other things. Hopefully you guys can enjoy it!

Modules, external factories, guava optionals strategy, logging tweeks

Marco Tedone

unread,
Nov 16, 2013, 3:53:51 AM11/16/13
to po...@googlegroups.com
Hi Antony, thank you for your contributions. I'll have a look at the changes. In the meantime, if you haven't already done so, it'd help if you could also update the HTML documentation to tell users how to use the Guava option and recursive collections. 

@Daniil, did you know that one test was failing in Java 7? 

Going forward we should be careful when contributing code and make sure that all tests pass both in Java 6 and 7. 

Regards,
M.

Sent from my iPad
--
You received this message because you are subscribed to the Google Groups "PODAM" group.
To unsubscribe from this group and stop receiving emails from it, send an email to podam+un...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Antony Stubbs

unread,
Jan 6, 2014, 8:46:51 PM1/6/14
to po...@googlegroups.com
Updated pull request, details there.

@Daniil, please check it out too - your version of the recursive fix i did seems to be incomplete. Or at least, the unit test I wrote for the issue still fails against your version of the fix. Maybe we both fixed different parts of the same issue?

Piotr Dytkowski

unread,
Feb 6, 2015, 10:48:24 AM2/6/15
to po...@googlegroups.com
How is it going with the guava support? I need that too. Was it finally merged?

Thanks,
Piotr

Piotr Dytkowski

unread,
Feb 7, 2015, 5:54:02 AM2/7/15
to po...@googlegroups.com
I was thinking about creating a factory interface, and being able to configure PodamFactory before using it. You could do something like: 

PodamFactory factory = new PodamFactoryImpl().withDataTypeFactory(MyDataType.class, new MyDataTypeFactory());

class MyDataTypeFactory {
  public MyDataType manufacture() {
    return new MyDataType();//this should return object with random data, as usually podam does
  }
}

and PodamFactoryImpl would hold a map of registered factories and whenever a type registered there is created it would use the factory.


I thought of that because Marco mentioned that project should support creating objects from external libraries (like guava) without dependencies on that libraries and that's an easy way to do it.

What are your opinions? I can make a PR with this concept implemented if you want to see it working.

Thanks,
Piotr

Piotr Dytkowski

unread,
Feb 7, 2015, 5:55:41 AM2/7/15
to po...@googlegroups.com
header of the MyDataTypeFactory should implement some interface: 

class MyDataTypeFactory implements DataTypeFactory {
...

Marco Tedone

unread,
Feb 7, 2015, 6:02:12 AM2/7/15
to po...@googlegroups.com
Piotr, that seems a good idea, provided that the public interface to create modules doesn’t change. By that I mean that the solution should be backwards compatible with existing Podam implementations, so typically all implementations that currently use: 

PodamFactory factory = new PodamFactoryImpl();

Should still work. Also, if you go down this path, I’d ask you to add usage examples to the html documentation, under src/main/site.

Regards,
M.


--
You received this message because you are subscribed to the Google Groups "PODAM" group.
To unsubscribe from this group and stop receiving emails from it, send an email to podam+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages