Pages

Wednesday, December 25, 2013

Sharing VO instance Across the Application Module.

 In Previous post I say that how to access the common application module(CommonAM) via java class. As i said earlier that there is a lot of ways to achieve that.

If you see my previous post at that end of the post i say that "I'll later explain little more simplifier than this post."

here is the way. 
All setup of the application is same as of previous post. just all we needed to do two important steps to achieve that. 

Step 1: Current Application(WorkApp). it doesnt have any entity,view objects.the snap which is showing EmployeesView is under the model imported from ADFSharedLib.
Just shuffle the EmployeeView to right hand side that is WorkAM. now you can able access the ViewObject instance.




Step 2: Just same method But now I'm writing in WorkAM implementation class. somehow altering some piece of line make more simpler.





if i follow above for 'n' Application module. then code duplication we will happens each every Application module implementation class. so re-usability will fail in my case. not for all of your cases.

Step 3: let us check the db data for the employee id '100'.


Step 4: Now i'm going the run BC tester.


Step 5: check the db data again for the employee id '100'.





finally get updated. this simple techniques get works. 


In next post I'll explain this how to do this same via bean through Bean through Datacontrol.


Tuesday, December 24, 2013

Access Application module from simple Java Class.

I got a requirement like accessing AM from a java class

Say as e.g.:           
           
Where I have a common Application Module(name it as CommonAM from CommonApp). 
It folds of common Entity Objects, ViewObjects. this CommonApp make it as ADFSharedLib).
This ADFSharedLib invoked it in each and every 'n' Projects. 
Then I try to access that commonAM and its entities and views in other Projects.

Note:
I dont want to use a Bean to access the commonAM via DataControl. 

So, I want to use one Java Class across all other Application Modules.

There are lot of ways to achieve that.
Here I'm going to share one way.I'm not sure this recommend practice. but we can also do by the way.

Step 1: Following Figure that how my CommonApp looks just employee eo , vo.



Step 2: I packed the CommonApp as ADFSharedLib.



Step 3: I'm trying to invoke the ADFSharedlib from File system.


Step 4: By creating root application while invoking the method at run time. I can able to access my view objects instances. 

say as e.g.: Creating a programmatic view criteria find the employee id and updating the salary...

After commit. there is no need to act as root. so i release the resource.




Step 5: finally i invoke this from current working application. that is WorkApp.
I'm trying to execute that from WorkAM.



Step 6: before executing let us check the db data. Now for the employee id '100' having the salary 2400.



 Step 7: Now i'm going to execute this method from BC Tester.




Step 8: After execution let us check in db. salary of the employee. 


It's updated. 
By this way i can able to communicate with my commonAM.

CommonApp Download here

WorkApp Download here

I'll later explain little more simplifier than this post. check this post.