-
Notifications
You must be signed in to change notification settings - Fork 619
DATAGRAPH-175: Improve HelloWorlds example #47
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…e it easier to interprete
…ier to interprete
|
Perhaps use repository.save(world) or template.save(world) instead of world.persist() Also I'm not sure about removing all the tests, b/c they show how you'd set up a test in a SDN scenario which I think is also important, so perhaps at least keeping one simple test for the MyWorldRepository would be sensible? I'm also not sure if we should keep the MyWorldRepository (which is rather a service), or just use the plain graph repository and create the worlds as part of the main app. WDYT ? Thanks Michael |
That's a good idea. In this case the only difference between aspects and plain version would be the World fields annotations. So, are we still going to have 2 totally separate projects? On one hand that makes sense because "hello world" should be as simple as possible and having a hello world of 2 maven modules seems really weird. On the other hand, we'll have to maintain both, just to demonstrate that there are 2 approaches and both provide almost the same with minor difference in the code. Regarding tests. What if we just implement a GalaxyService (@service) that provides a POJO interface (WorldDTO instead of World) and internally uses SDN? In this case:
Does this sound like a plan? |
|
Sounds good. We could have one pom with a secondary profile for the aspexts dependency. Michael Sent from mobile device Am 16.05.2012 um 09:26 schrieb loki2302 reply@reply.github.com:
|
|
Thank you Michael - will do it later today. |
…lasses with GalaxyService
|
Hmm I don't think the DTO and Mapping add simplicity to the example, I'd rather have it straightforward and minimal. |
|
That's not a final version. I'm away on business, so there are no changes so far. |
|
ok cool :) |
|
Hello Michael, My 2 primary points here are:
Point 1 is important because otherwise we'll only be able to test SDN things. That's a nonsense because there's a bunch of tests in SDN project and writing these tests once again just doesn't make any sense. On the other hand, writing tests for the service means we "state" that there's a couple of scenarios implemented in the service and we just show what these scenarios are. Point 2 is pretty close to point 1 - just if we expose SDN entities to the user, it's a kind of SDN testing, so much more interesting is testing what we exactly implemented in the demo. We could probably use detached SDN entities instead of DTOs. Not sure if there's a real profit, but at least we won't have mapper and DTO. Just less code. Could you please clarify your expectations regarding the code? Thanks, |
…o-worlds: aspects and plain. The code doesn't work as expected. Commiting just for back-up
|
Sorry I don't get it. The DTO conversion is only useful if you want to serialize the data in a certain way or provide it to some other layer that doesn't know and doesn't care about the domain (e.g. ui-views or some processing). In this case where it is about the domain, why move away from the domain classes? This example should be about the mapping to the graph and usage of template and repositories, everything else will imho just confuse the reader. |
|
OK. In this case I'm just removing this extra mapping layer and use the entity classes as is. Thanks! Will commit later today. |
|
Hey Andrey, I have a couple of comments.
Keep the advanced concept for other tutorials ;) Lasse |
|
Hi Lasse,
Andrey A. |
|
@Andrey: |
|
You've never seen it before. Brand new. Exclusive. Only 4 files of code. It's time for the future!
I'm firmly against of removing the service and moreover, now there is a real argument: is much more readable than Hope that's fine now :-) |
|
Thanks Andrey! |
DATAGRAPH-175: Improve HelloWorlds example
Hello Michael,
Please review my changes for DATAGRAPH-175 - "Improve HelloWorlds example". Things I did:
I'm slightly concerned about having cloned code in both applications - differences are really minor, so the most of the code is just the same. Please, let me know what you think.