How to consume External Services in DDD [closed] - api

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 2 years ago.
Improve this question
I have a project in DDD and I would like to know in which layer I have to code a Service to consume an external service. In this case the external service is about information (especifically payment slips) to show in the Front-End.

The question is a bit vage, but my guess is that you have a bounded context and you even have an UI for this bounded context. Now you would like to show some data from another (external)BC in the UI of your BC.
Before creating an application service for that, ask yourself: what should the user do with this information? Does it help to solve some business problem of your BC? Does the user take different actions inside your BC depending on the payment slip data that he or she sees? If so, then you probably need to model those busines rules explicitly inside the domain model of your BC, create some sort of relationship to the other BC and agree on a contract to get the data to satisfy your invariants.
If you just need a shortcut/convienience for the user in the UI then try to push this feature to the UI level, maybe a simple link to the other context is enough...
Reaching out to external BCs should not be done careless, since every external dependency makes your BC less independent and valuable on its own. First try to clarify the communication to the other context using one of the strategic design patterns like anti-corruption-layer, customer-supplier, conformist etc. After this analysis it should be easier to determine in which layer an how you would put the logic for this external call.

Related

All Facade is an API? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 9 years ago.
Improve this question
The facade pattern is to provide a simplified interface for complex code.
Therefore, it is correct to use it as a wrapper for a system? That would be like a translation map for facilitating the understanding hiding the complexity?
Is it correct then call all Facade as API?
Well the programming interface into any application is the Application Programming Interface, so yes it would be an API, in the same way that your OS has an API keeping you from fiddling with too much memory or abstracting the hard drive - or a game engine has an API acting as a facade for graphics and audio code.
So yes, the implementation of a Facade is an API, but so is any other code which you use as an interface into a more complicated system. (I guess you could ask the question as "are all APIs a facade that just provides a layer of abstraction?" - and you could probably make the argument that it's true).
It's a bit of an odd question to consider however, because depending on who you talk to, these terms may change - we only really use them to represent the idea of abstraction, as we see fit.
Remember that design patterns are not hard fast rules. A Facade is an API that reduces the complexity of using some system. That system may be a single library, multiple libraries, various network clients, etc.

Adaptive vs Non Adaptive System [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
Assume there is a website that generates pages using dynamic technologies: ASP, JSP, etc.
In a non-adaptive website, I may have a code like if condition 1, then generate page A. If condition 2, generate page B and so on.
In an adaptive system, what is the similar logic? is it correct to say if by evaluating context, user request, etc (in a sense if condition 1), the solution is adaptation policy should generate page A to ensure goal of serving the right page is consistent?
I'd be grateful if you could help me understand the difference / similarities.
Heike
P.S. I am reading about self adaptive systems and just needed to point out that this is not a homework question :)
You can read more about self-adaptive system in the IBM site about autonomic computing.
The Vision: Systems manage themselves according to an administrator's
goals. New components integrate as effortlessly as a new cell
establishes itself in the human body. These ideas are not science
fiction, but elements of the grand challenge to create self-managing
computing systems.

Questions every good Struts Developer should be able to answer? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 5 years ago.
Improve this question
In the line of Questions every good Java/Java EE Developer should be able to answer?
I would like to ask what are the Questions every good Struts Developer should be able to answer?
Looking forward for some good responses.
1. What is the basic flow of a Struts handled request?
You can find a short description here and plenty of resources on the web.
(If you pretend to know Struts then there is no excuse for not knowing number 1)
Next question is "What is a Servlet?" (and I'm not kidding; if they fail number 1 they are going to fail to this also, trust me).
2. Is ActionForm part of the Model in MVC?
People think the ActionForm is part of the Model. They read the MVC description and think... Hey!... this is the Model's state, lets move this as parameters all over the Model. Now you have a tight coupling between the Model and the Struts framework.
There are plenty of examples in which the ActionForm properties are mapped 1:1 on DTO POJO objects and those used instead, but people think its a waste of code and time and just pass it along to the Model.
(Number 2 can can be excused for a junior and is later cured by experience)
3. Do you put your business logic inside the Action class? Why? Why not?
An Action is an adapter between the contents of an incoming HTTP request and the corresponding business logic that should be executed to process this request... 'nuff said
(Number 3 is also cured by experience)
Difference between filters and Interceptors ?
Action Chaining
classes used as part of struts framework.
Validation Plugin
struts Configuration.

Steps to create workflow using Mule ESB? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 5 years ago.
Improve this question
If you had to create a list of steps that a non-technical business layperson would understand for implementing workflows in something like Mule ESB -- what would it look like? The scenario would be to describe how the ESB is used to perform integration between two disparate systems and the steps you would need to perform to get the job done.
An Enterprise Service Bus is a technical middleware for system integration. It is doubtful whether mixing the business aspects into the picture makes sense. For business people to look at a picture and 'get it', the technical aspects would either be abstracted away and or require a tacit understanding of the technology. Better to keep them separate.
On the business logic level you should use BPML for workflow modelling:
http://en.wikipedia.org/wiki/Business_Process_Modeling_Notation
The technical aspects of a service bus are captured through Enterprise Architecture Integration patterns:
http://www.eaipatterns.com/toc.html
The EAI view is already abstract, but expecting business people to understand this is like handing them UML diagrams and assuming they're literate by nature (alas, they are not).

Best approach to design a service oriented system [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 4 years ago.
Improve this question
Thinking about service orientation, our team are involved on new application designs. We consist in a group of 4 developers
and a manager (that knows something about programming and distributed systems). Each one, having own opinion on service design.
It consists in a distributed system: a user interface (web app) accessing the services in a dedicated server (inside the firewall), to obtain the business logic operations.
So we got 2 main approachs that I list above :
Modular services
Having many modules, each one consisting of a service (WCF).
Example: namespaces SystemX.DebtService, SystemX.CreditService, SystemX.SimulatorService
Unique service
All the business logic is centralized in a unique service.
Example: SystemX.OperationService. The web app calls the same service for all operations.
In your opinion, whats the best? Or having another approach is better for this scenario?
A web service is an interface. The invoker doesn't care how a service works, it just needs to know what arguments to supply and what outcomes to expect. So a multitude of simple, discrete servcies is probably better.
Behind their interfaces they can all join up in one great big bundle of business logic. Who cares?
In practice, teach of hese services will share some elements of SystemX functionality and will have some elements which it alone uses. Some may combine elements of SystemX and SystemY. If SystemX and SystemY are legacy apps it may not be possible to change them, so we have to work with them as they are. In other scenarios it is possible to expose impose modularity on them.