Hi Daniel, thank you for your response.
I'm not an experienced developer, so maybe the answer I'm looking for is the knowledge of something that I'm lacking of.
When I'm writing an application using a new framework that isn't familiar for me, I want to focus on building the features first. I think that I'll understand the framework later, learning a part of the framework when I really need to. Do I have to really understand the framework first? From what I understand, the business logic and the flow of application can be made reusable so that when I'm migrating to another framework, I'll just have to adjust a few parts that related only to the framework.
What's bothering me from doing this is the characteristic of the framework that could make my business logic and application flow need a lot of rework. For example: let's say that I need to save the states of my objects, and framework A gives me that functionality. Now when I need to migrate to framework B, for some reasons, I can't save any object states. This will make me do a major rework in my business logic.
Another example: framework A is single threaded, so I don't need to think about concurrency in my code, object X will patiently wait until object Y finished doing its long running operation, and X finally can make a decision based on the data retrieved by Y like the 'model.getSomething()' example above. But in framework B, the work that object Y does can only be done in another thread so that object X cannot wait for object Y. X can only hope to be called back when Y has done its job.
If that's the case, is it unavoidable to rewrite my controller from handling single threaded to multi threaded model? The controller I made has no assumption about the environment it is running on. If it's really unavoidable, then I need to rewrite the flow of my application.
According to ports and adapters pattern, can my application layer be completely free of rewrites when I migrate to arbitrarily different environment? Let's say that my boss decided to change the system from using Swing GUI to Java EE web application.
I'm sorry if I can't make myself clear due to my lack of experience, I still have much to learn.
Thank you,
Samuel