This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | |
<parent> | |
<groupId>org.sonatype.oss</groupId> | |
<artifactId>oss-parent</artifactId> | |
<version>7</version> | |
</parent> | |
<modelVersion>4.0.0</modelVersion> | |
<groupId>org.mygroup</groupId> | |
<artifactId>myproject</artifactId> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<servers> | |
... | |
<server> | |
<id>sonatype-nexus-snapshots</id> | |
<username>john.j.rambo</username> | |
<password>rambospass</password> | |
</server> | |
<server> | |
<id>sonatype-nexus-staging</id> | |
<username>john.j.rambo</username> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
abstract class AbstractPlayerRepositoryTestTemplate { | |
protected PlayerRepository testObj; | |
@Test | |
public void exists() { | |
// setup | |
... | |
//assert | |
assertTrue(testObj.exists(playerId)); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
interface PlayerRepository { | |
boolean exists(PlayerId playerId); | |
} | |
class InMemoryPlayerRepository implements PlayerRepository { | |
@Override public boolean exists(PlayerId playerId) { ... } | |
} | |
class MongoPlayerRepository implements PlayerRepository { | |
@Override public boolean exists(PlayerId playerId) { ... } | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class UserLifecyleService { | |
private IUserRepository userRepository; | |
public void createUser(User user) { | |
//do some stuff, logging, authentication,... | |
userRepository.create(user); | |
//do some stuff, send out an event or whatever | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//application service - orchestrates beetween domain services and objects, | |
//authenticates, handles transactions, .... | |
class PlayerAccessoriesService { | |
public void assignAvatarToPlayer(Integer playerId, Integer avatarId) { | |
authenticationCheck(); | |
logging(); | |
transactionStart(); | |
playerService.assignAvatarToPlayer(playerId, avatarId); | |
transactionEnd(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class PlayerId { | |
private final Integer value; | |
public PlayerId(Integer value) { this.value = value; } | |
public Integer getValue() { return this.value; } | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class PlayerService { | |
public void assignAvatarToPlayer(PlayerId playerId, AvatarId avatarId) { ... } | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class PlayerId { | |
private final Integer value; | |
public PlayerId(Integer value) { | |
Validate.notNull("Player Id must be non-null", value) | |
this.value = value; | |
} | |
public Integer getValue() { return this.value; } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
interface Compressor { | |
CompressedContent compress(UncompressedContent uncompressedContent); | |
} | |
interface CompressedContent { ... } | |
interface UncompressedContent { ... } | |
class ContentDownloader { | |
void downloadCompressAndSave(Compressor compressor) { | |
UncompressedContent uncompressedContent = downloadContent(); |
OlderNewer