Comments (9)
Yeah that's right, I'm mostly not resolving stuff out of the IoC Container yet because I've only written the unit tests so far. Once I start writing the Controllers and wiring stuff together I'll be resolving stuff out of the Container.
So you're right, I'm not at the minute, but I will need to.
Hope that makes sense 😄
from cribbb.
Thanks for the prompt answer Phil :)
I was interested to see how you're resolving the object interfaces such as which implementation of the UUID to use etc.. Will these be done using a service provider? Don't worry about it if this is way too early and you haven't though about it yet.
from cribbb.
Yeah that's exactly what I'll be doing :)
However for UUID's in particular I'm just going to be depending on https://github.com/ramsey/uuid
from cribbb.
It's possible that I'm missing something here...
The User private constructor requires the $id to be a UserId but neither the static resister nor the UserRegister Service are building the Uuid object or generating the Uuid string. Also since the service is not expecting a Uuid object I don't think that it's generated in Application layers.
from cribbb.
The UserId
is created from the repository https://github.com/yellowflag/cribbb/blob/master/app/Infrastructure/Repositories/UserDoctrineORMRepository.php#L41
from cribbb.
HI Philip,
Sorry for the long thread of questions but I'm still struggling to understand this particular process.
The service creates the User object:
$user = User::register($id, $email, $username, $password);
This static method needs a UserId:
public static function register(UserId $userId, Email $email, Username $username, HashedPassword $password)
{
$user = new User($userId, $email, $username, $password);
return $user;
}
But the repository is triggered afterwards in the service:
$this->userRepository->add($user);
So how is the Uuid generated from the repository to be sent to the User object since botht he static and the constructor require an instance of the Uuid?
from cribbb.
The UserId
is requested from the nextIdentity()
method of the repository here https://github.com/yellowflag/cribbb/blob/master/app/Domain/Services/Identity/RegisterUserService.php#L55
from cribbb.
Lol... I didn't see that :)
Thanks.
from cribbb.
No problem 😄 Give me a shout if anything else doesn't make sense!
from cribbb.
Related Issues (10)
- Models with repository(storage) responsibility. HOT 1
- should i use model's method directly in controller ? HOT 2
- Repositories not found HOT 1
- can't find domain driven development folders HOT 1
- Tests HOT 1
- Bug when register an user and checking the invite filter HOT 8
- ¿How do you load your package inside Laravel? HOT 3
- Please put old code up HOT 3
- Publish laravel 4 version, before the Laravel 5 updates. HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cribbb.