Kamal Mettananda - SCJP 1.4 (98%)
The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus
Originally posted by Ilja Preuss:
Am I understanding correctly that ExchangeData is the class of the objects that will be passed between the applications (a DTO)?
Kamal Mettananda - SCJP 1.4 (98%)
Originally posted by Kamal Mettananda:
Hi all,
I'm doing a design and have to make a decision at a point on which way to go.
Following is the situation.
1. Our application talk to another existing application.
2. Our application and their system have a set of matching objects for communication.
3. Our app talk to their app by passing objects that they are expecting, so they return results in their format. Then we convert the returned results back to our types.
4. I'm writting a generic code to match all record types. My code will be as follows.
Originally posted by Timothy Frey:
The key here is that each object is responsible for converting itself into its counterpart.
Kamal Mettananda - SCJP 1.4 (98%)
Originally posted by Peer Reynders:
Actually given this description I would think that you should first focus on a facade for your application.
Kamal Mettananda - SCJP 1.4 (98%)
The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus
Originally posted by Kamal Mettananda:
Not sure how Facade would apply in this case. As I know mainly facade applies in simplifying a complex interface.
Kamal Mettananda - SCJP 1.4 (98%)
SCJP 1.4, SCWCD 1.3, SCBCD 1.3
The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus
Originally posted by Kamal Mettananda:
Would you be able to explain these against my current problem?
Or using a sample problem?
Kamal Mettananda - SCJP 1.4 (98%)
Originally posted by Kamal Mettananda:
Which means all the classes in Client side application are dependent on main Systems types.
Originally posted by Peer Reynders:
To further decouple the client domain RecordImporter should actually be an interface.
.... However the more extensible approach is to get the converter to tell you whether it can deal with the subclass:
Kamal Mettananda - SCJP 1.4 (98%)
Originally posted by Peer Reynders:
If you don't want to throw an exception at least return a NullObject (you only need one instance) or in your case a NullClientResult.
In my opinion you have made SystemHandlerImpl unnecessarily dependent on CustomerConverter, ContactConverter, ClientResultConverter, SystemImporter and ClientRecordSystemsImporterAdapter when it only needs to depend on ClientRecordImporterAdapter.
So I'd prefer that the SystemHandler is assembled during startup and injected into the classes that need it.
1. By making SystemHandlerImpl only dependent on interfaces you can more effectively unit/integration test.
Kamal Mettananda - SCJP 1.4 (98%)
Originally posted by Kamal Mettananda:
Ok, I'll try that.
So we'll be asking to client to use the Factory to get access to the SystemHandler as:
So we'll be asking to client to use the Factory to get access to the SystemHandler as
No idea about the following code fragment
You have provided some hints on unit testability with decorators.
This cake looks terrible, but it tastes great! Now take a bite out of this tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
|