All Questions
18 questions
-4
votes
1
answer
69
views
Calculate math function depend on N value [closed]
I have method with the following prototype :
R[] = method(k,n)
which :
n = ordinal value 0 <n <10^9
k = math function depend on n value : i.e n^6
R = array of computed values
For example :
n = ...
1
vote
0
answers
83
views
Hierarchy of models while designing a client for a RESTful service
I am trying to write a client for a restful service. I am confused in designing the models. Below are the details:
I have a Model named UnicastMessageRequest, it's definition is like this:
...
0
votes
3
answers
2k
views
Shouldn't cost be good reason to migrate to .Net from Java
I have a RESTful services developed using Java Spring framework. It's not a huge application, around 12K lines of Java code. Front end is in Angular and DB is No-SQL world.
Recently I came to know ...
31
votes
9
answers
11k
views
Designing a Class to take whole classes as parameters rather than individual properties
Let's say, for example, you have an application with a widely shared class called User. This class exposes all information about the user, their Id, name, levels of access to each module, timezone etc....
22
votes
7
answers
15k
views
Should "Set" have a Get method?
Let's have this C# class (it would be almost the same in Java)
public class MyClass {
public string A {get; set;}
public string B {get; set;}
public override bool Equals(object obj) {
...
2
votes
4
answers
160
views
Are names like OrderCreation and UserRegistration suitable names for business logic / domain classes
We have moved to a more SRP model and found coming up with class names challenging. Previously we had a Order class that looked something like this:
public class Order
{
public void Create()
{...
2
votes
2
answers
165
views
Should we add an extra class to this code sample
I have a shopping website which allows users to place orders. In my web application when the users click 'Create Order' i call an OrderService class which looks like the below:
public class ...
-2
votes
1
answer
91
views
What is better to design or discover interface [closed]
Let's say you have some issue to develop. And as recommended practice it is good idea to use interfaces ( I don't mean GUI, I mean interface or abstract class ). And you can apply two ( I'm pretty ...
0
votes
3
answers
616
views
Assigning responsibility for cancelling an Order
During a conversation with our Domain Expert we can across this feature:
A Customer service agent can cancel an Order by decreasing its quantity. To cancel an Order we decrease its quantity by the ...
0
votes
2
answers
2k
views
how to approach pharmacy software project [closed]
I would like to complete a pharmacy software proof concept. But I have a few questions I do not know.
Physician information
In order to refill or dispense a new RX the software needs to have access ...
5
votes
1
answer
3k
views
State pattern vs Inheritance
In the following image for the State Pattern from Applying Domain-Driven Design and Patterns: With Examples in C# and .NET
I'm trying to persist the SalesOrder entity into the database. Normally I ...
7
votes
5
answers
5k
views
How to model an address type in DDD?
I have an User entity that has a Set of Address where Address is a value object:
class User{
...
private Set<Address> addresses;
...
public setAddresses(Set<Address> ...
4
votes
1
answer
32k
views
Why would one prefer C# (ASP.NET MVC) or Java (JSP) instead of PHP for web applications/projects [closed]
I'm wondering, why would one (consider it not just a single developer, but a company) prefer C# or Java for web applications? What's their considerations regarding the question. I mean, a company, has ...
8
votes
2
answers
2k
views
Domain Services as facades
I read .NET Domain-Driven Design with C#: Problem - Design - Solution and I noticed that the author created a domain service for each aggregate root.
However, the domain services were only facades to ...
4
votes
4
answers
2k
views
Should we validate a state transition before attempting it in the State Pattern?
When applying the State Pattern illegal transitions should result in an exception being thrown (or at least that's what I understood from the pattern)
I know exceptions are for "unexpected behavior" ...