DDD Domain vs Aggregates - domain-driven-design

I'm trying to wrap my head around DDD.
Say we have a job board website where Organisations can post jobs and an Applicant can apply.
Is my understanding correct that, there would be a Recruitment domain with:
JobPost and JobPostApplication as aggregates
HiringOrganisation and Applicant as entities of their respective aggregate
Recruitment
└── Model
├── Entities
│   ├── Applicant
│   └── HiringOrganisation
│   └── Location
├── ValueObjects
│   └── Salary
│   └── EmploymentType
├── JobPost
└── JobPostApplication
If so, how would:
the Applicant relate to the User from the Auth domain
the HiringOrganisation relate to the Organisation in the Organisations domain

how would
the Applicant relate to the User from the Auth domain
the HiringOrganisation relate to the Organisation in the Organisations domain
Typically: shared identifiers. Some value (often an opaque token, like a UUID) is shared by both contexts, so that we can correlate messages that are talking about the "same" thing, in different spaces where the data evolves over time.

Related

how to identify domains, subdomains and bounded contexts in an online retailer integration scenario?

The problem I'm facing is the design of an integration platform.
The company has different tools used for selling online financial services and wants to unify the selling process by creating a common integration platform.
Existing tools range from simply designing a tailor-made offer, to managing all the phases of listing to selling and supporting. The integration platform should orchestrate all the tools.
So I do approach this problem from a DDD point of view?
Domain: selling online services
subdomains: service catalog, request offers, sending offers, buying service, support customer.
bounded context? maybe integration with other company systems like identities and invoices?
My trouble with this is that some existing applications encompass several subdomains, others don't. Also, some applications working in the same subdomain have completely different languages, for example, service vs product, vs project...
How does an integration platform fit in this picture and how would you approach it from a DDD point of view? (or maybe it's a completely wrong approach and should I leave DDD inside each tool and treat them as bounded context?)
I recommend extracting the common bits of meaning (ignoring their names) from the various applications into common domains/bounded contexts. Each bounded context has anti-corruption layers that essentially adapt the language used in one or more existing applications to the one used in the common domain (and vice versa). Then you can cut over the existing applications piece-by-piece to use the respective ACLs to take advantage of the common domain implementation.
Eventually, you might even be able to dispense with the ACLs, as the language becomes more ubiquitous, but it's also perfectly okay to keep them around forever: the ACLs introduce some indirection (and possibly complexity, e.g. if they're deployed as their own microservices) but that's the price you pay for limiting coupling to the ACL.
(It's not clear from the question how experienced you are with DDD).

Hyperledger fabric applications clarification [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 2 years ago.
Improve this question
When people say that Hyperledger fabric is for enterprises solutions it means that the nodes could be the users that are granted access? or it has to be different enterprises cooperating?
Would granting access to the users through unique phone number be feasible?
Sorry for the dumb questions it's for a uni project and I can't find clear informations
Fabric is a private/permissioned block chain, and only verified nodes can participate.
In order to verify the nodes on the Internet network, that is, to verify the identity, a PKI system is common.wikipedia/PKI
That is, each node has its own private key and certificate (public key) with authority, and in Fabric, it is controlled under the name of MSP (Membership Service Provider). Fabric MSP
MSP is easy to get confused by their name, but they can be seen as somthinmg... files of crypto-config artifacts rather than objects that take action.
Would granting access to the users through unique phone number be feasible - Lorenzo Bonelli?
In fact, it is difficult to answer this question. First of all, I wonder if you are a developer, what is the background, and what is the target system.
First of all, I will assume that you basically know the structure of hyperledger-fabric.
Looking at the question, I think that the identity of a specific subject is digitally mapped to a phone number. Here, I think that users mean clients and peers in the fabric.
1.client
In the case of a client, it can be applied very easily. clients must be given a unique name during the registration process. of course, since the phone number must be able to be changed or modified, it seems to be correct to perform a separate mapping at the application level.
userID: 82+10-4036-xxxx
2. peer
In the case of peers, it seems that they can map this to their own name.
For example, when building a peer in a fabric network,
It is written in the expression of <peer_name>.<org_name>.<domain_name> like
peer0.org0.example.com
In this process, peer_name can be mapped to a phone number.
82+10-4036-xxxx.org0.example.com
Of course, the problem that occurs in the above process is that it is difficult to respond flexibly when the phone number is changed. in order to solve this part, it is desirable to implement a separate mapping table
When you create a mapping table, you have to think about who will manage how.
In the end, it is necessary to implement middleware in a form that requires the identity resolver/registry of the blockchain network.
Consider how to operate and manage it from the perspective of the blockchain.
to put it simply, middleware construction is required on the front of the blockchain, and pay attention to the philosophy of the blockchain..
(ex)
| number | uuid |
| 82+10 | '1b9d6bcd-bbfd-4b2d-9b5d-ab8dfbbd4bed' |
client): '1b9d6bcd-bbfd-4b2d-9b5d-ab8dfbbd4bed'
peer): 1b9d6bcd-bbfd-4b2d-9b5d-ab8dfbbd4bed.org0.example.com
If it tells you a more specific situation or goal, I'll consider a more appropriate form.

Unity assets store defense

I am making asset for assets story. I want sell it there.
But my assets most consist of scripts. Anyone can buy it and after a litle modify put in a assets store.
How can I defense it?
I believe there is no way to fully prevent it, but the Asset Store use terms got you covered:
http://unity3d.com/company/legal/as_terms
Section 2.2 of "End User's Rights and Obligations"
Licensor grants to the END-USER a non-exclusive, worldwide, and perpetu- al license to the Asset to integrate Assets only as incorporated and embed- ded components of electronic games and interactive media and distribute such electronic game and interactive media. END-USER may otherwise not reproduce, distribute, sublicense, rent, lease or lend the Assets.
If you discorver someone has in fact modified and is reselling your work, you have the legal upper hand.

Designing domain model issue

First of all thanks for your input on this issue. I am fairly new in Domain Driven Design and banging my head around for solution to some issues (I think they are very basic, I am surely missing something).
Let me first describe my domain a bit. I am trying to model a typical school, which can have classrooms, each classroom can have multiple section/groups and students within each classroom group.
Users are mainly school administrator and teacher. School administrator can create classroom, teacher and student whereas teacher can create only group and assign students to a group.
School has global identity, but the classroom does not have. Classroom has local identity when it is part of the School Entity. Classroom group is unique only within classroom.
School is definitely an Aggregate root with Classroom aggregate inside and is responsible for creating, deleting, updating classroom.
Should we create a different aggregate root for Classroom and classroom groups (which I think not right as they don't have global identities within the domain).
Do we create separate repository for each of them?
Should we handle creation/update of classroom, classroom group at the service level?
We need to cache the data and Event sourcing seems to be a good idea to maintain state in synch. Do you see any issue with this?
Any help will be greatly appreciated.
I think you should create a Classroom aggregate root. You will probably list classrooms in some reports, will you?
Only for aggregate roots. Children of roots are fetched by parent aggregate root repository.
No. If you use Entity Framework, it's enough for you to add a Classroom group inside Class object List. EF should take care of the rest. Beware of deletions though!
If you're talking about http://martinfowler.com/eaaDev/EventSourcing.html, isn't it just a way to track changes?

express.js sample apps [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 6 years ago.
Improve this question
I am starting an express.js project. I want to look at code of exiting large apps, especially their file system structure. Anyone knows of apps that use express.js and are on github?
Here's my layout.
./myapp
./public -- static files
./modules -- modules I made for reusability
./routes -- like controllers
./log -- app log file
./views -- ejs views
./config -- config.development.js, config.global.js
./templates -- email templates (text/html in ejs)
./pid -- for server
./init -- git post-receive hook for deploy
./models -- mongoose schemas
Take a look at my answer to ExpressJS How to structure an application. You can also look at the repo for my own web site, which although neither large nor exciting, is an express app and has a pretty sane filesystem and code organization scheme (IMHO).
Of coures, browse the list of ExpressJS applications on the main Express site. Not sure which if any are open source, but have a look through those.
Express is kind of notorious for not really having any specific guidance on how to lay out the folder structure and build big apps. To be fair, it's not really intended to be a "Rails", it's more of a light layer that simplifies basic HTTP features.
There may be some Express examples on Github, but none off the top of my head.
You may want to take a look at RailwayJS which is a lot closer to the expected "Rails" on top of Express. You may also want to take a look at Geddy which is used for large-scale apps. Geddy is not Express-based, but has more explicit guidance on how to structure everything.
In my express app, I have more or less this structure:
project
|--app.js
|--bin
| `--shell scripts and stuff*
|--docroot
| `--static files, etc*
|--node_modules
| `--npm downloads go here*
|--lib
| |--vendor
| | `--jar files and stuff*
| |--my-custom-middleware1.js
| `--my-custom-middleware2.js
|--package.json
|--README.md
`--templates
`--a bunch of templates*
Works fairly well for what I need.
This not a very large scale project but it gives you a basic idea about how to structure you application it's a REST API https://github.com/khurrumqureshi/BotnikServer
Have a look at the examples of express that you can find at the github repository. If you are into MVC there is also an example for it. They give you a good first idea on how to structure your app.
More on how to structure your app is in the express faq under "How should I structure my application?"
There are a ton of apps on github that use express. For a large project you can look at krakenjs.com. Which is not really an app but more of a structure for an app that was created by paypal when they switched from java to node.js.
You can also look at more full stack app structures like mean.io or meanjs.org if you want to use angular.js and mongodb. Even if you don't you can get an idea of how they structure their code.

Resources