A list of puns related to "Domain Model"
Let's say we have a domain model which had only one legal state at the beginning of its lifetime, this is easy to enforce by only providing a single public constructor which guarantees a legal object if you provide the correct parameters. Then the object or model can change its state if some method is called, it is easy to persist the model after it has changed since all the properties have public getters. The problems begin when I need to reconstruct the model from database, I have only one constructor and the only way to get the model into the correct state compared to the database is to play back all the mutating actions needed to get it there. This is basically Event Sourcing, which is a fine solution to the problem. Another way is to use reflection like many ORMs do, but that is basically cheating, we are constructing the object in a way not intended and circumventing the business logic in the model. ORMs force you change the design of your model to fit their conventions (empty private constructors and many other annoying things).
Basically, is there another way to keep your domain models clean than Event Sourcing, which does not use some magic (reflection), forces you to add constructors only needed by the persistence layer or worst of all, makes property setters public? Is their some pattern/trick I am not aware of?
Hey everyone, it's been a while since I've posted here but still going strong and posting game assets! Below you'll find a collection of 100 models made in the style of old PS1 games. Low-fi textures, simple geometry and a grungy style.
If you'd like even more assets in a similar style check out this collection over on GitHub.
License: CC0 (public domain), completely free to use in personal, educational and commercial projects (no permission/credit required). Download includes license file.
I've been doing C# for about 4 years now and never seen DDD or clean architecture being applied in the companies I've worked at. These places rarely even have unit tests. So, in my spare time I'm trying to learn and apply these principles.
I'm trying to create an ASP Core API using DDD principles. I have a persistence layer using repository pattern with persistence models and a unit of work for those sets of repositories. This layer lives in separate class libraries, split between persistence models/interfaces and implementation.
In my API, I have a services folder that contains folders with my use cases. I inject units of work interfaces into the service classes. The flow I envision is the request comes through the controller, the controller validates the requests and calls the service class methods, and returns some response.
This is the part where I'm stuck. In these service classes, do I map my persistence models into domain models? What if the domain models are eerily similar to the persistence models with little business logic? What if my domain model depends on two separate persistence models as just bags of data? And what is the best way to do this mapping?
I recently came across Martin Fowlers criticism of the anemic domain model, of which I realized I am guilty. A quick explanation of this is that the business logic resides in an application/service layer above the data model. Instead of using object oriented principles for data updates, validation etc, where this logic is contained in the data object itself, like fooEntity.validate()
you have a service layer responsible for mutating the object states. If you have a FooEntity
then you would also have a FooEntityService
with operations like fooEntityService.validateFoo(foo)
etc.
Fowler considers this to be an anti-pattern because it is not taking advantage of OO principles, objects can end up in an erroneous state if the service layer is not properly used to mutate them etc.
I would like some more input on this topic. I primarily develop in Java/Kotlin, meaning we of course use Spring and dependency injection. I feel that the anemic domain model is more compatible with this paradigm since many mutative operations on object state will require the aid of some other component which is autowired/injected into the application context. Surely I can't inject other service classes and couple them to my data layer just to have it be able to perform some mutation or validation on itself? If I can't do this then I will have to put some of these operations in the data layer, and other ones with more complex dependencies in the service layer. Surely splitting my logic between the data layer and the service layer must be even worse?
Has Fowler's criticism of the anemic data model obsolete by the dependency injection trend or is there still something to it? How do you structure your applications in this respect?
Hello, guys. I am working on books sharing platform. I want to build my main logic at domain level to not be totally depend from database.
So some of my constraints and uses cases at first step are:
Here is my boilerplate code:
from typing import List, Optional, Any, Set
from dataclasses import dataclass
@dataclass(unsafe_hash=True)
class Book:
isin: int
title: str
author: str
released_year: int
description: str
image: Optional[List] = None
class User:
def __init__(self, login, email):
self.login = login
self.email = email
self.shelf = Shelf(owner=self)
def __repr__(self):
return f"<User>: {self.login}"
class Shelf:
def __init__(self, owner: User, books: Set[Book] = None):
self.owner = owner
self.books = set() if books is None else books
def __len__(self):
return len(self.books)
def __repr__(self):
return f"Owner: {self.owner.login} Books: {self.books}>"
@property
def number_of_books_on_shelf(self):
return len(self.books)
def add(self, book: Book):
if isinstance(book, Book) and self.can_add(book):
self.books.add(book)
def remove(self, book: Book):
if book in self.books:
self.books.remove(book)
def can_add(self, book: Book) -> bool:
return book not in self.books
And I have few questions. So I don't know how about User class and self.shelf = Shelf(owner=self)
class User:
def __init__(self, login, email):
self.login = login
self.email = email
self.shelf = Shelf(owner=self)
Is it good idea to do that this way ?
I just wonder how to have a good design for Bookshelf and User. Access to bookshelf should be only through the User ? I mean User.shelf.get_books() ? Or there is better way to design it to have seperate Bookshelf and seperate User and to have access to it as to seperate object ? And question how to connect this objects then ?
Good afternoon,
I have encountered an odd issue with my OS deployment Task Sequence, in which it fails to join the domain successfully despite using the same USB->Ethernet adapters for all other models. The new laptop in question is the HP Elitebook x360 830 G7 and the previous models were the HP Elitebook x360 1030 G4, G3,... Although I'm not sure this is of any consequence as I am using the same Realtek USB GBE Ethernet adapter for both models. All the other models will succeed in joining the domain.
I have looked into the NetSetup.Log file and note that the failed computer does not even show an attempt to join the domain:
03/01/2021 12:11:38:576 -----------------------------------------------------------------
03/01/2021 12:11:38:576 NetpDoDomainJoin
03/01/2021 12:11:38:576 NetpDoDomainJoin: using new computer names
03/01/2021 12:11:38:576 NetpDoDomainJoin: NetpGetNewMachineName returned 0x0
03/01/2021 12:11:38:576 NetpMachineValidToJoin: 'WIN-SEDLFNQ1PCQ'
03/01/2021 12:11:38:576 NetpMachineValidToJoin: status: 0x0
03/01/2021 12:11:38:576 NetpJoinWorkgroup: joining computer 'WIN-SEDLFNQ1PCQ' to workgroup 'WORKGROUP'
03/01/2021 12:11:38:576 NetpValidateName: checking to see if 'WORKGROUP' is valid as type 2 name
03/01/2021 12:11:38:583 NetpCheckNetBiosNameNotInUse for 'WORKGROUP' [ Workgroup as MACHINE] returned 0x0
03/01/2021 12:11:38:583 NetpValidateName: name 'WORKGROUP' is valid for type 2
03/01/2021 12:11:38:587 NetpJoinWorkgroup: status: 0x0
03/01/2021 12:11:38:587 NetpDoDomainJoin: status: 0x0
------
Whereas a working log from any other model in our fleet shows:
02/11/2021 14:08:21:929 -----------------------------------------------------------------
02/11/2021 14:08:21:929 NetpDoDomainJoin
02/11/2021 14:08:21:929 NetpDoDomainJoin: using new computer names
02/11/2021 14:08:21:929 NetpDoDomainJoin: NetpGetNewMachineName returned 0x0
02/11/2021 14:08:21:930 NetpMachineValidToJoin: 'WIN-D9UK2ATDB46'
02/11/2021 14:08:21:930 NetpMachineValidToJoin: status: 0x0
02/11/2021 14:08:21:930 NetpJoinWorkgroup: joining computer 'WIN-D9UK2ATDB46' to workgroup 'WORKGROUP'
02/11/2021 14:08:21:930 NetpValidateName: checking to see if 'WORKGROUP' is valid as type 2 name
02/11/2021 14:08:21:932 NetpCheckNetBiosNameNotInUse for 'WORKGROUP' [ Workgroup as MACHINE] returned 0x0
02/11/2021 14:08:21:932 NetpValidateName: name 'WORKGROUP' is valid for type 2
02/11/2021
... keep reading on reddit β‘In recent years, Natural language processing (NLP) techniques are adopted widely to solve the programming languagesβ tasks to assist the software engineering process. A growing number of sophisticated NLP applications make researcherβs life more convenient. The transformer model (combined with transfer learning) has been established to be a powerful technique for NLP tasks. However, not many studies focus on the applications for understanding source code language to ease the software engineering process.
Researchers from Google AI, NVIDIA, Ludwig-Maximilians-University, and Technical University of Munich (TUM) have recently published a paper describing CodeTrans, an encoder-decoder transformer model for the software engineering tasks domain. The proposed model explores the effectiveness of encoder-decoder transformer models for six software engineering tasks, including thirteen sub-tasks.
Paper: https://arxiv.org/ftp/arxiv/papers/2104/2104.02443.pdf
GitHub: https://github.com/agemagician/CodeTrans
Is anyone aware of any efforts to collect data models? I was thinking something as simple as a github repo linking to/storing domain-specific models.
While a lot of the specifics/nuance of models will be program/functionality specific, I feel like there is a real use to having some generalized baselines as starting points for projects/useful learning resources.
According to the paper in order to preprocess I have to "For an input image, we first employ block DCT on it to obtain 64 histograms of DCT coefficients corresponding to 64 frequencies. Following the process of [28], we then carry 1- D Fourier transform on these DCT coefficient histograms to enhance the effect of CNN. Considering that CNN needs an input of a fixed size, we sample these histograms and obtain 64 250-dimensional vectors, which can be represented as {H0,H1, ...H63}."
I am trying to implement this using python and I have a few doubts regarding this.
First I want to know how to obtain 64 histograms of DCT coefficients corresponding to 64 frequencies using block DCT and if block DCT is different from DCT since there are python libraries which have DCT already.
Second I want to know what the input size of this, I want to know how it is related to the 64 250-dimensional vectors. I don't have a great understanding on this topic and would greatly appreciate any support I can get.
Thanking you in advance,
muiz1
Happy New Years CISSP studiers!
The First, greatly anticipated, MindMap video for Domain 4 is now available. This one focuses on the OSI Model: https://youtu.be/6X4A6B94vmw
Topics covered include The OSI Model, OSI Layer 1: Physical, Media, Wired: Twisted Pair, Coaxial, Fiber Optic, Wireless: Radio Frequency, Infrared, Microwave, Network Topologies (Bus, Tree, Star, Mesh & Ring), Handling Collisions (CSMA/CA & CSMA/CD), Layer 1 Devices (Hubs, Repeaters & Concentrators), Layer 1 Protocols (802.1x), OSI Layer 2: Datalink, MAC Address, Layer 2 Devices (Switches & Bridges), Layer 2 Protocols (ARP, PPTP & SLIP), OSI Layer 3: Network, IP Address, Layer 3 Devices (Routers & Packet Filtering Firewalls), Layer 3 Protocols (ICMP, IPSec & IGMP), OSI Layer 4: Transport, Ports = Services, Common Ports, Layer 4 Protocols (TCP/UDP & SSL/TLS), OSI Layer 5: Session, Layer 5 Devices (Circuit Proxy Firewall), Layer 5 Protocols (NetBIOS & RPC), OSI Layer 6: Presentation, OSI Layer 7: Application, Layer 7 Devices (Application Firewalls), Layer 7 Protocols (HTTP/S, DNS, SSH, SNMP, LDAP & DHCP)
Here are the other review / MindMap videos I have completed so far:
Domain 2
Domain 3
Domain 4
Domain 5
Domain 6
Domain 7
Good afternoon,
I'm thinking it's an issue with the driver pack .CAB for the Dell Precision 7550 but hear me out.
We use MDT to image a variety of Dell Optiplex, Latitude, and Precision systems. When we get a new model in, we create a new folder for the new system's drivers, import them from the relevant .cab, import the latest WinPE .cab, rebuild the entire deployment image, and then we are successfully imaging the new systems. All of this happens on servers with SSDs, so it doesn't take as long as you might think.
Except for these new Dell Precision 7550 laptops. The OS installs fine, the apps install fine, but the domain join step never happens, and I don't know how to kick start from this step or find the log files to diagnose what's happening. I have deleted all the Precision 7550 drivers and the WinPE drivers, reimported both twice, and rebuilt the deployment image twice, with no positive results.
Where can I go to troubleshoot this issue further, or is there a glaring issue from someone here with more experience?
I have been asked why no admissible model of QL has an empty domain. Apparently there is a modal principle that enforces this...
So far I have come up with the possibility that QL needs to express a subject/predicate relationship and this is why a QL model with an empty domain is not admissable. I have also been thinking about the principle of bivalence and law of excluded middle but am grasping at straws here, would love some clarity on the matter
all input appreciated, thanks
Canterbury Society of Model Engineers is having an open day at Halswell Domain. $2 train rides. Miniature steam carousel. Bring the kids.
https://preview.redd.it/teq8dnkw62c61.png?width=2880&format=png&auto=webp&s=feffa19f9dca11c2577282a3bbfdfc9b85f94e94
Hello everyone. With major thanks to u/fireflame241, I was able to make this pixelated version (miniaturized for the illusion of smoothness) of the colored domain model for the Riemann Zeta function. It can be used for any other complex function as well, as long as one knows how to split a complex function into real and imaginary components. Thanks also to u/DurkinPhD for inspiring me with his original contour plotter idea. :) https://www.desmos.com/calculator/pi4gwb4dha?lang=en
According to the paper in order to preprocess I have to "For an input image, we first employ block DCT on it to obtain 64 histograms of DCT coefficients corresponding to 64 frequencies. Following the process of [28], we then carry 1- D Fourier transform on these DCT coefficient histograms to enhance the effect of CNN. Considering that CNN needs an input of a fixed size, we sample these histograms and obtain 64 250-dimensional vectors, which can be represented as {H0,H1, ...H63}."
I am trying to implement this using python and I have a few doubts regarding this.
First I want to know how to obtain 64 histograms of DCT coefficients corresponding to 64 frequencies using block DCT and if block DCT is different from DCT since there are python libraries which have DCT already.
Second I want to know what the input size of this, I want to know how it is related to the 64 250-dimensional vectors. I don't have a great understanding on this topic and would greatly appreciate any support I can get.
Thanking you in advance,
muiz1
Please note that this site uses cookies to personalise content and adverts, to provide social media features, and to analyse web traffic. Click here for more information.