Discussion in ‘Starting a Business’ started by abumax, Jan 26, 2021 at 2:24 PM.
(You must log in or sign up to post here.)
New and Fresh Private + Public Proxies Lists Everyday!
Get and Download New Proxies from NewProxyLists.com
Discussion in ‘Starting a Business’ started by abumax, Jan 26, 2021 at 2:24 PM.
(You must log in or sign up to post here.)
Discussion in ‘Growing and Managing a Business’ started by abumax, Jan 26, 2021 at 2:29 PM.
(You must log in or sign up to post here.)
This is a simple eCommerce application containing a Products inventory managed by an Admin. The Products in inventory/repository will show in the User App. Admin has the ability to mark ON/OFF a Product. ON = display in User App, OFF = do not display. Products are maintained in a single table (Products) in database.
This system is built (read: attempted) on DDD principles.
The Products data in db is accessed in code via .NET Entity Framework.
There are two different Applications (Admin App and User App) created.
Admin
.StoreView
. (FYI – Entities from Admin domain are not mixed/reused here.)IProductRepository
, has GetProducts()
.Where to place this (ON/OFF) “business logic”? (BTW, this is a business logic, right? OR is it an “application logic”?)
According to DDD, business logic should be maintained in the Domain layer. However, this is a “query” (product.Status == “ON”). Where should this logic be put – Domain Entity, Domain Service, Repository or Application?
I found these two questions closest to my problem, but I can’t find the answer, alas.
Handling Business Logic/Validation Race Conditions
How to completely avoid business logic in DAL?
Write the query business logic in IProductRepository, e.g.
public IEnumerable<Product> GetProducts()
{
return db.Products.Where(p => p.Status == "ON").ToList();
}
Disadvantage: This does not look like how to do things in DDD.
Get ALL Products from repository, and then apply condition in Application Service/Controller/somewhere like that.
Disadvantage: ALL Products will be loaded in memory and then filtered. Also, I am not sure if this conforms to DDD.
Have an AggregateRoot, say, Store
. Store contains a property for Products. Get entire Store, including ALL Products from repository, and the “filtering” happens in Products’ getter.
ICollection<Product> _products;
ICollection<Product> Products
{
get { return _products.Where(p => p.Status == "ON").ToList(); }
private set { _products = value; }
}
Disadvantage: ALL Products will be loaded in memory. Also, keeping ALL Products throughout Store entity’s life-time seems really odd.
Maintain two separate tables for Products, maybe in two different schemas: admin.Products and storeview.Products.admin.Products
will be populated by Admin users.
Raise a DomainEvent when Status
is updated for a Product.
A Domain/Application EventHandler subscribed to the above event will create/update storeview.Products
table.
NO query logic required in StoreView
domain or “UserApp”.
Disadvantage: Additional complexity and infrastructure overhead of maintaining two separate tables in db.
What is the most-appropriate solution, in terms of DDD, strictly?
Which business is best for women which they can start with less investment?
I am a Digital Marketer. I am expert in Local SEO Citations. Local Citations are the most effective way to Rank Your Business or Website.
What I will be Do In Service ?
Why You Choose Me ?
Order Now
.(tagsToTranslate)Localcitations(t)Locallistings(t)Localseo(t)Local(t)Citations(t)Offpageseo
I’d like to scrape all business page from one selected facebook category and after grab datas (business name, city, country, phone number, whatsapp number, e-mail) which page was active at the last 180 days.
I think need custom data grabber but I cannot grab locations. I was tryed based on this video: https://www.youtube.com/watch?v=X3Ep-NXg…tsLoopline
If you can help me, please let me know! Thanks!
Hello Guys,
I have been working in a Digital Agency for 2 years, Due to the current pandemic situation across the globe, I am working from home
and now, I was thinking of changing my pace in my career and decided to set up an own office business for a digital agency in my hometown, I searched online on how to register a new business online and came across a couple of registrations of websites. Every website has different procedures, and it is very much confusing. I would really appreciate it if anybody could help me by advising me on the above.
Waiting for your positive reply
Thank You.
.