Greetings,
I have a program divided by packages and I also divide the logic of the interface, I am using the DAO and Factory models.
I have some Get methods within a JFrame - I'll call it Class A - that refer to text fields, access to these methods Get from another class that has a Save method - this one I'll call Class B -.
The problem arises because I created an instance of Class A in Class B to access the Get methods of JFrame and save the information.
Likewise, I created an instance of Class B in Class A to call the Save method within a button.
>Because I repeatedly call two objects, a circular dependency error is created between A and B leading to a StackOverFlowError . . p>
My question is: how can I call the two classes without this error occurring?