Skip to content

Commit 9d3d348

Browse files
committed
refactor(docs): README.md and some minor changes to the doc
1 parent a343b52 commit 9d3d348

File tree

2 files changed

+187
-5
lines changed

2 files changed

+187
-5
lines changed

README.md

+159
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,159 @@
1+
[//]: # (DDD in Django)
2+
3+
[//]: # (A project for the course "Advanced Software Engineering" at the DHBW Karlsruhe)
4+
5+
[//]: # (by Marc Gökce, 2023)
6+
7+
# Domain Driven Design in Python 🐍
8+
9+
---
10+
11+
###### Sperrvermerk
12+
13+
This project is a _restructuring_ of my existing blog site (www.mkrabs.de) using Domain Driven Design
14+
principles, as part of the Advanced Software Engineering course in the 6th semester at the Duale Hochschule of
15+
Karlsruhe. The project code is publicly available on GitHub, but please note that I do not take any responsibility
16+
for the use of this code / architecture or other mishaps you might write in other projects. I am not liable for any
17+
negative outcomes, poor grades or broken snakes resulting from the use of this code, as it is intended for educational
18+
purposes only.
19+
20+
_Use at your own risk, lmao._
21+
22+
---
23+
24+
###### Table of Contents
25+
26+
Will update as time marches on
27+
28+
29+
30+
---
31+
32+
This project uses python as the programming language and Django as the overlord framework. This is how I plan to
33+
structure the project: It will incorporate 3 main layers: domain, application and infrastructure, whilst using some
34+
lesser important ones like abstraction and presentation.
35+
36+
### Domain
37+
38+
The Domain layer encompasses the crucial business logic and entities of the application, including user accounts, blog
39+
posts, comments, and likes. It defines the fundamental concepts and behaviors of the application, and is composed of
40+
pure Python code that is technology-agnostic and easy to comprehend and maintain. The entities within this layer serve
41+
as the fundamental building blocks of the application and embody the core business requirements. Additionally, the
42+
repository interfaces defined within this layer facilitate data access and manipulation. By separating domain-specific
43+
concerns from implementation details, the Domain layer promotes better reasoning and modification of the application.
44+
45+
```
46+
todo: add code
47+
```
48+
49+
### Application
50+
51+
The Application layer encompasses the use cases and business logic of the application, dictating how the core entities
52+
are utilized and manipulated to accomplish specific objectives, such as generating a blog post or commenting on a post.
53+
This layer relies on the Domain layer and interfaces with the Infrastructure layer to execute necessary operations. The
54+
services within this layer encapsulate the business logic and furnish a more elevated API for the presentation layer to
55+
engage with. By dividing the business logic from implementation details, the Application layer streamlines the process
56+
of adjusting and advancing the application.
57+
58+
```
59+
todo: add code
60+
```
61+
### Infrastructure
62+
63+
The Infrastructure layer serves as a bridge between the Domain layer and the persistence layer, which is typically a
64+
database or a file system. This layer is responsible for implementing the necessary infrastructure to enable the
65+
application to interact with external systems, such as web APIs, file systems, or databases. The repositories defined
66+
within this layer provide a way to persist and retrieve data from the underlying storage system. The implementation of
67+
these repositories may vary depending on the chosen technology, such as ORM frameworks or raw SQL queries. The
68+
Infrastructure layer is crucial because it isolates the application's business logic from the underlying implementation
69+
details of external systems, ensuring flexibility and maintainability.
70+
71+
```
72+
todo: add code
73+
```
74+
### Presentation
75+
76+
The Presentation layer encompasses the user interface and presentation logic of the application, dictating how users
77+
engage with the application and how data is presented to them. This layer relies on the Application layer to retrieve
78+
and manipulate data. The resources defined in this layer, including HTML, CSS, and JavaScript, determine the visual
79+
aesthetics and behavior of the application. The primary Python file serves as the application's entry point and manages
80+
user requests. The Presentation layer is important because it provides the necessary user-facing components, rendering
81+
the application accessible and usable to individuals.
82+
83+
```
84+
todo: add code
85+
```
86+
### Test
87+
88+
The Testing layer is dedicated to testing the application. Testing is an integral aspect of software development, as it
89+
confirms the functionality of the application and identifies any defects or issues before release. The test directory is
90+
segregated into two subdirectories: unit and smoke.
91+
92+
The unit directory contains unit tests that test the functionality of individual components in isolation. These tests
93+
verify that each component of the application performs as expected independently of its interaction with other
94+
components. Unit tests are crucial in ensuring that the application's building blocks function as intended.
95+
96+
The smoke directory contains integration tests that validate the integration between different layers of the
97+
application. These tests ensure that the application's components communicate with each other correctly and that the
98+
different layers interact with one another as intended. Integration tests are essential in guaranteeing the overall
99+
behavior of the application.
100+
101+
Both types of tests are significant in ensuring the quality and correctness of the application. By writing tests,
102+
developers can detect errors and issues early in the development process, reducing the costs and time required to
103+
address them. Furthermore, tests serve as documentation for the application's behavior, simplifying the understanding
104+
and modification of the code for future developers.
105+
106+
```
107+
todo: add example of unit test and smoke test
108+
```
109+
---
110+
111+
# Conclusion
112+
113+
###### and or summary
114+
115+
## Summary of the work done
116+
117+
## Review of the benefits of using DDD principles
118+
119+
## Future work and improvements
120+
121+
###### Back to top [](#table-of-contents)
122+
123+
---
124+
125+
# References
126+
127+
###### Write the references used in the project
128+
129+
* https://docs.djangoproject.com/en/4.2/misc/design-philosophies/#models
130+
* https://www.cosmicpython.com/book/preface (very nice)
131+
* https://wiki.c2.com/?CouplingAndCohesion
132+
* https://iktakahiro.dev/python-ddd-onion-architecture
133+
* https://www.amazon.com/Domain-Driven-Design-Tackling-Complexity-Software/dp/0321125215
134+
* https://github.com/jdiazromeral/django-ddd
135+
* https://openbase.com/python/Django-ddd
136+
* https://michalgodkowicz.medium.com/another-way-to-persist-ddd-aggregates-in-django-d148f4cad298
137+
* https://www.apress.com/gp/blog/all-blog-posts/domain-driven-design-with-django/16172586
138+
* https://thedomaindrivendesign.io/why-use-domain-driven-design/
139+
140+
###### Video References
141+
142+
* https://www.youtube.com/watch?v=hv-LiKQgN90
143+
* https://www.youtube.com/watch?v=Ru2T4fu3bGQ
144+
145+
###### Back to top [](#table-of-contents)
146+
147+
---
148+
149+
_Thank you for reading._
150+
151+
[@MKrabs](https://www.github.com/MKrabs) - [Website](https://www.mkrabs.de)
152+
153+
[//]: # (Styles)
154+
<style>
155+
156+
ol { list-style-type: upper-roman; }
157+
ol ol { list-style-type: decimal; }
158+
159+
</style>

docs/ASE_is_fun/structure.md

+28-5
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,11 @@ _Use at your own risk, lmao._
5454
- [Implementation of the persistence layer](#implementation-of-the-persistence-layer)
5555
- [Explanation of the approach and benefits](#explanation-of-the-approach-and-benefits-4)
5656
- [Unit Testing](#unit-testing)
57-
- [Implementation of at least 10 unit tests](#implementation-of-at-least-10-unit-tests)
58-
- [Adherence to ATRIP rules](#adherence-to-atrip-rules)
57+
- [Unit tests](#unit-tests)
58+
- [Integration tests](#integration-tests)
59+
- [Smoke tests](#smoke-tests)
5960
- [Use of mocks in testing](#use-of-mocks-in-testing)
61+
- [Adherence to ATRIP rules](#adherence-to-atrip-rules)
6062
- [Explanation of the approach and benefits](#explanation-of-the-approach-and-benefits-5)
6163
- [Conclusion](#conclusion)
6264
- [Summary of the work done](#summary-of-the-work-done)
@@ -130,6 +132,13 @@ as it existed before the start of this project.
130132

131133
###### Chapter 2
132134

135+
- [x] Überlegen wie domaine aussieht
136+
- [ ] was macht diese aus.
137+
- [x] was sind die wichtigsten Begriffe
138+
- [x] was sind die wichtigsten Konzepte
139+
140+
## Domain Terms
141+
133142
The Analysis of Ubiquitous Language is a crucial step in the development of any software system, as it helps to
134143
establish a common language and understanding between the development team and the stakeholders. This chapter will focus
135144
on defining the domain terms, identifying the domain concepts, and creating a glossary to ensure that everyone involved
@@ -158,8 +167,7 @@ to learn more about the user and their interests.
158167

159168
User profiles, also referred to as portfolios, are collections of personal information and preferences that allow other
160169
users to learn more about a particular user. The user profile contains personal information, including the user's name,
161-
profile picture, and bio. It also contains personal tags that show the user's interests or link to other websites. Users
162-
can customize their profile with different themes and templates.
170+
profile picture, and bio. It also contains personal tags that show the user's interests or link to other websites.
163171

164172
##### Comment
165173

@@ -195,6 +203,13 @@ administrators to review the content and take appropriate action to ensure the s
195203

196204
## Definition of the entities, value objects, and aggregates
197205

206+
value object: immutable / statisch
207+
zB kategorie
208+
209+
Django using active records.
210+
211+
Not anymore, we ditched django.
212+
198213
## Specification of the domain services
199214

200215
## Implementation of the repositories
@@ -303,6 +318,14 @@ administrators to review the content and take appropriate action to ensure the s
303318

304319
## Use of mocks in testing
305320

321+
## Adherence to ATRIP rules
322+
323+
- Automatic
324+
- Thorough (Vollständig)
325+
- Repeatable
326+
- Independent
327+
- Professional
328+
306329
## Explanation of the approach and benefits
307330

308331
###### Back to top [](#table-of-contents)
@@ -325,7 +348,7 @@ administrators to review the content and take appropriate action to ensure the s
325348

326349
# References
327350

328-
###### Write the references used in the project
351+
###### Written references used in the project
329352

330353
* https://docs.djangoproject.com/en/4.2/misc/design-philosophies/#models
331354
* https://www.cosmicpython.com/book/preface (very nice)

0 commit comments

Comments
 (0)