Tag Info

New answers tagged

0

I think that answer to behavior extension cannot be abstracted itself - it depends on concrete problem. If we assume that pulling sledge is unusual dog behaviour* (encapsulate what varies) another level of abstraction would be the answer, but it would be different in case of pulling-sledge-contest-app where a dog can pull sledge in generall, but some are to ...


0

You should return a 4xx error with a detailed description of the reason the request failed in the response body. Can't help with the Java implementation. In many Python frameworks you would throw a 4xx exception as soon as your code has determined that the HTTP request is going to fail and this is caught by the framework and returns a 4xx HTTP status ...


0

I think you're missing the transactional analysis. Which entities will be modified by each of your use cases ? Will some of them impact more than one entity ? What are your invariants ? Do some of them span multiple entities (e.g., two Terms can't use the same Room at the same date/time) ? Are they true invariants or could eventual consistency be ...


2

Customization is as simple or complex as introducing any other requirement. Each time you add a custom business rule or a business rule modification to your application, analyse how to make this rule visible or invisible, active or inactive, available or not available by some kind of run-time switch. Think of the customization step just as an extra, ...


0

The question you should be asking yourself is if the effort saved on maintenance (by not having to change code for future user requests) or the additional versatility (such as being able to easily convert and market the app to different users) are worth the additional effort of creating a more generalized system. Don't write a universal condiment dispensing ...


0

JDT's answer is pretty good, but another option you might want to consider is a domain-specific language (DSL). In this approach you define a simple language to capture your workflows, provide primitives for specialized checks and steps, etc., and then write an engine to interpret and execute them. By keeping everything in a database, or hard-coded, you ...


3

I can think of two possible solutions here, but they both require a fair amount of development (but I really can't see a solution where this is not the case). I would also recommend not developing any specific kind of check step until it is actually needed. It's very easy to have requirements for 42 different kinds of automated steps that end up having only ...


1

If you have an entity as in a DDD-entity (not what is generally called an entity in frameworks such as entity framework) then the entity should protect its invariants. Thus using the entity as a DTO is most likely wrong. A DTO is unvalidated input data from the user and should be treated as such. An entity is validated data in one of the object types valid ...


0

If your presentation layer is always co-located with your Data Access Layer (DAL), which is often the case for server driven web apps (or standalone GUIs), you should typically not need a DTO layer: just use the entities directly. If your presentaion layer can be remote, then DTO is a good idea. And, yes, a DTO can be used inbound as well as outbound, i.e. ...


6

Usually, services call other services when they need to access their data. Each piece of data should belong to a particular service which will be the only entry point to accessing this data and modifying it. Some services will be simple and usually correspond closely to your domain model (e.g. a service for handling users) while others will be high-level and ...


1

The application primarily deals with users, profiles owned by users, photos, and tags that represent one to many profiles in a photo. There would conceivably be methods to return photos uploaded by a user, return photos that contain a certain tagged profile, etc. Well, profile service should not work with user object. It may know only the ID of ...


0

I suggest that you should separate the Customer and SocialInsuranceNumber entities into their own classes, as clearly both contain data and have behaviour: Create a SocialInsuranceNumber class, and move the isValid() method into this class as a static method isValid(int CandidateSIN). It could be a member function, but that means it is possible to create ...


0

Well, I don't see any problem here, actually. To consider something to be a validation rule of the object, you must be able to take an object and tell me exactly how do you validate this object to satisfy the rule. In your case there is no condition clearly defined when to apply this rule, so I would say you have no validation rule at all ;) ...in some ...



Top 50 recent answers are included