Using the BusinessDelegate pattern at lower levels

I was hoping to elicit some feedback on general J2EE architecture...
We have an application that we separate into three general tiers: web/client tier, service tier (with 'services' that implement business logic) and a data tier (with 'controllers' which basically implement CRUD (create, read, update, delete) for a single domain object or table). We have this thing called a 'manager' that straddles the service and data tier which also implements CRUD, but at a more coarse grained level. Managers allow us to work with big objects that are actually a composition of small objects.
Our services and managers are almost always implemented as session beans (stateless) so the client tier uses a "Business Delegate" as per Sun's J2EE patterns to hide the implementation details of those services and managers. So a given call in the system would look like:
Struts action class -> business delegate -> manager or service -> controller -> entity bean
Managers and services, when they need to work with persistent data then use controllers to get at that data. Most controllers are currently session beans (stateless), but we are starting to add controllers that implement the DAO pattern.
I'd like to hide the implementation details of those controllers from the managers and services that use them, though. I hate seeing code in managers/services where we use ServiceLocator to look up a home interface, create the EJB controller and then do method calls.
My question is whether it's possible and appropriate to use a BusinessDelegate between two session beans such as our 'managers' and 'controllers'. Doing so would make a given call in the system would look like:
Struts action class -> business delegate -> manager or service -> business delegate -> controller -> entity bean (if used). Would you loose the transaction between manager and controllers (managers always use Required for each method and controllers use Supports - as well, controllers only ever expose a local interface).
Thanks for any advise/opinions you might have.
Donald

In your framework, does each delegate become a single
InvocationHandler instance
Yes, exactly.
with (for instance) a
constructor that does the EJB lookup and an invoke()
method?
EJB lookup is being done by a ServiceLocator.
Do you have ServiceLocator return the proxy object (I
know that traditionally ServiceLocators merely return
EJB home interfaces,
My does the same. But it's used by EJBDelegateFactory, which creates EJBDelegates.
EJBDelegates implement InvocationHandler and support InvocationDecorators.
but I have used them to return
POJO implementations of interfaces so it becomes a
kind of implementation factory).
Nice idea. I have POJOLocator for that.
Do you have your Proxy object implement the EJB
interface, rather than creating a new one.
Yes. The only drawback is that client code needs to catch EJB specific and remote exceptions.
However it's not a big problem, because there is a decorator which catches all EJB exceptions and throws BusinessDelegateException with a user-friendly error message inside. This means that EJB interfaces need to declare BusinessDelegateException in throws clauses, but it doesnt cause any problems.
So client code is something like:
try {
      foo.invokeSomeMethod();
}  catch (BusinessDelegateException  ex)
     displayErrorMessage(ex.getMsg);
}   catch  (Exception ex)
      //   can be empty
I have
been thinking about creating a new one and then seeing
if I can change xdoclet's templates to have the EJB
interface extend this interface.
I have used this idea, too. I think it's even called a pattern. You can make EJB bean to implement this interface and then you have compile time checking of EJB compliance.
I remember I had problems with that when some CORBA client stub generator got confused.
Thanks for any little advise you can provide.
Maybe I will even put my framework as OS in WEB. If my client will allow me to do it.
best regards,
Maris Orbidans

Similar Messages

  • How do I use the Match Pattern Function to exclude only 0.000?

    Hi,
    I'm trying to use the mattch pattern function to find the first string in a table thats is >0. My table looks like:
    1,0.000000,0.000 %2007/01/13 00:16:19 196281
    1,0.000000,0.000 %2007/01/13 00:16:22 196282
    1,0.831262,0.000 %2007/01/13 00:17:20 196375
    2,0.811154,0.000 %2007/01/13 00:17:20 196375
    If I us the paremeter "1,[~0]" It doesn't find the line 1,0.831262,0.000... which is the one that I want. I also tried :1,[0-9].+[~0] and that didn't work either. the problem is that the first digit after to 1, isn't allways going to go from 0 to 0.0 sometimes it might go from 0 to 2.??.
    Thanks for the help
    Matt

    "Matt361" <[email protected]> wrote in message news:[email protected]..
    Hi,
    &nbsp;
    I'm trying to use the mattch pattern function to find the first string in a table thats is &gt;0. My table looks like:
    1,0.000000,0.000 %2007/01/13 00:16:19 196281
    1,0.000000,0.000 %2007/01/13 00:16:22 196282
    1,0.831262,0.000 %2007/01/13 00:17:20 196375
    2,0.811154,0.000 %2007/01/13 00:17:20 196375
    If I us the paremeter "1,[~0]" It doesn't find the line 1,0.831262,0.000... which is the one that I want. I also tried :1,[0-9].+[~0] and that didn't work either. the problem is that the first digit after to 1, isn't allways going to go from 0 to 0.0 sometimes it might go from 0 to 2.??.
    &nbsp;
    Thanks for the help
    Matt
    &nbsp;
    Hi,
    1,[~0] matches a "1" a "," and then any character that is not "0".
    1,[0-9].+[~0] matches a "1" a "," and then any character that is "0-9", any number of anything!! (1 or more) and then anything that is not "0". Note that you have to escape a . to match a ".". Like this "\.".
    There is no way to check if there is anything other then a "0" in the match, from within the match pattern function. So I think you won't be able to find a pattern that does the trick.
    Why not use a whileloop to find the first item? Or use the Spreadsheet String To Array, and then compare the desired row or column with the string "0.000000"? (Or replace all ,0.000000, by a string like ",NULL,", then match the pattern?)
    In LabVIEW 8 there is a new Match Regular Expression function. Haven't tried it, but it should be much more powerfull then the Match Pattern function. But also much more complex.
    Regards,
    Wiebe.

  • How we can limit the number of concurrent calls to a WCF service without use the Singleton pattern or without do the change in BizTalk Configuration file?

    How can we send only one message to a WCF service at a time? How we can limit the number of concurrent calls to a WCF service without use the Singleton pattern or without do the change in BizTalk Configuration file? Can we do it by Host throttling?

    Hi Pawan,
    You need to use WCF-Custom adapter and add the ServiceThrottlingBehavior service behavior to a WCF-Custom Locations.
    ServiceThrottlingBehavior.MaxConcurrentCalls - Gets or sets a value that specifies the maximum number of messages actively processing across a ServiceHost. The MaxConcurrentCalls property specifies the maximum number of messages actively
    processing across a ServiceHost object. Each channel can have one pending message that does not count against the value of MaxConcurrentCalls until WCF begins to process it.
    Follow MSDN-
    http://msdn.microsoft.com/en-us/library/ee377035%28BTS.10%29.aspx
    http://msdn.microsoft.com/en-us/library/system.servicemodel.description.servicethrottlingbehavior.maxconcurrentcalls.aspx
    I hope this helps.
    Rachit
    If this answers your question please mark it accordingly. If this post is helpful, please vote as helpful by clicking the upward arrow mark next to my reply.

  • Why have I lost the ability to use the Background Brush in Low Key in my Photoshop Elements 11 Program??? Need this fixed!!!

    Why have I lost the ability to use the Background Brush in Low Key in my Photoshop Elements 11 Program?????  I need this fixed, can anyone help me???

    I'd try resetting the pse 11 preferences.
    In the pse 11 editor Adobe Photoshop Elements Editor (Edit)>Preferences>General, click on Reset Preferences on Next launch
    and then restart the pse 11 editor.

  • Design dialog program using the MVC pattern

    Hi,
    I have to design a dialog program using the MVC pattern , with all the controllers lying inside function modules.
    I have searched out on net and could find out that BSP applications are designed using the MVC concept.Please suggest how can the dialog program be designed using MVC pattern.

    I'm currently developing a classic Dynpro dialog program.  I have a module pool, with screens.  I've tightly coupled the module pool with a controller class.  Anything that happens in the module pool, is handled by the controller class. All the logic of screen handling is done by the controller class.
    What remains in the module pool is the capturing of the okcode. the next screen to go to (if applicable), the setting of field attributes.  But the okcode is sent straight to the controller for processing, and the screen/field information is also held in the controller.
    I've also rewritten the auto-generated tab handling code, so the logic is done via a class. 
    So, it is possible - just aim to have as LITTLE as possible in the module pool or function group.
    The model, of course, is in a separate class.

  • [AS3] how do i use this angle in another lower level movie clip?

    i'm tryin to use an angle from one movie clips to be part of
    an if statement in another lower level movie clip. my code is
    probably ugly but here it is. thank you in advance for the
    help

    i need to learn how to declair a variable (like angle) in a
    lower level movie clip to use it in other movie clips is this not
    correct?
    var angle:Number;
    please help

  • Do I use the Brdige pattern for this problem ?

    Hello
    I'm making a music mixer for mobile phones. For the canvas, i divided it up in tiles, to fill
    up with .png images if you want to place a sample in that specific tile. But if you have a phone with no colors and your screen is not big enough, the image is almost all black. So I want to create a different class, to only show a letter or a simple symbol if you can't handle the .png well.
    I read about the bridge pattern, where you encapsulate the implementation in an abstract class and seperate it from the base class with the abstractions. Should I use this pattern for my problem ? I have some doubt because I have multiple implementations (color vs non-color) but I don't have multiple abstractions (a tile to fill up with a symbol or picture).
    Are there other patterns that are more suited for my problem ?
    What about the implementation? Should I see the implementation as only producing the image or symbol, or should i see it as the whole canvas, with the tile system?
    For example, now the tiling looks good on most of the targeted phones. But what if the next generation of mobile phones has a screen with very different dimensions. Wouldn't it be better to incorporate this also in the implementation ?
    Thanks

    What are you trying to do when you say "When I put the password for my apple ID into icloud- it keeps reverting to another password"?
    Where are you doing when you try to enter your password?

  • NAC - Using ActiveX web agent with low level user

    Hi:
    I have NAC installed in-band and running. We have a group of test taker with user rights to the PC. The ActiveX web agent will not load and the Java agent does not start.
    Any suggestion o dealing with some low secuirty issue and the browser.
    Thanks
    Dan

    Hi Eduardo,
    We can check all the requirement rules, but notes,
    this check is works well with native win agents, so I assume the CAM Requirements and Rules side is ok.
    Pls. confirm, there is no matter how I'd like to check win patches (via web or with client) at Checks/Rules/Roles/Requirements config.
    Attila

  • "Low-level" authorizations for accessing BW reports - add users to role

    Using the advice in Topic "Low-level" authorizations for accessing BW reports, I have been able to publish a query to a role that has 3 test users and each user gets the same query but with different data, as determined in the tables.
    Is there a way to look up the users and e-mail addresses from a table and associate them to the role? We have several hundred e-mail recipients that will not need BW access, but only need an e-mail with a static report that contains data on their own territories.

    Hi!
    i think programatically it might be complex. You got to maintain a seperate variant of report per user and use this variant to send mail. that means you need to maintain a variant and a Broadcast setting per user. once maintained you can use it any number of times the values will be recalculated everytime.
    with regards
    ashwin
    <i>PS n: Assigning point to the helpful answers is the way of saying thanks in SDN.  you can assign points by clicking on the appropriate radio button displayed next to the answers for your question. yellow for 2, green for 6 points(2)and blue for 10 points and to close the question and marked as problem solved. closing the threads which has a solution will help the members to deal with open issues with out wasting time on problems which has a solution and also to the people who encounter the same porblem in future. This is just to give you information as you are a new user.</i>

  • Using a Visitor Pattern to apply the Law of Demeter?

    I don't understand how to use Law of Demeter (LoD) with hierarchical classes and the Visitor Pattern.
    The hierarchy of classes is for example (with relationships): Article [m:m] Supplier [m:1] Address.
    If I want to set the address, I would normally have to code something like: article.getSupplier(4711).getAddress().setStreet("G.W. Bush Street 1"); // ironic
    I don't know much of LoD, but I think this example violates it heavily.
    How does the solution for this example look like with respecting LoD by using a Visitor Pattern?
    And what do you think about it?

    TO use the visitor pattern all the visited objects
    must have a common interface, and I don't see one
    between Supplier, Address and Article.I think they don't need a common interface. Look at the sample code:
    package test;
    class VisitorPattern {
         public static void main(String[] args) {
              Cheese cheese1 = new Wensleydale();
              Cheese cheese2 = new Gouda();
              Cheese cheese3 = new Brie();
              Visitor v = new VisitorImpl();
              cheese1.accept(v);
              cheese2.accept(v);
              cheese3.accept(v);
    interface Visitor {
         void visit(Wensleydale w);
         void visit(Gouda g);
         void visit(Brie b);
    class VisitorImpl implements Visitor {
         public void visit(Wensleydale w) {
              System.out.println(w.wensleydaleName());
         public void visit(Gouda g) {
              System.out.println(g.goudaName());
         public void visit(Brie b) {
              System.out.println(b.brieName());
    interface Cheese {
         void accept(Visitor v);
    abstract class BaseCheese implements Cheese {
    class Wensleydale extends BaseCheese {
         String wensleydaleName() {
              return "This is wensleydale";
         public void accept(Visitor v) {
              v.visit(this);
    class Gouda extends BaseCheese {
         String goudaName() {
              return "This is gouda";
         public void accept(Visitor v) {
              v.visit(this);
    class Brie extends BaseCheese {
         String brieName() {
              return "This is brie";
         public void accept(Visitor v) {
              v.visit(this);

  • Help building an executable that uses a factory pattern

    Hello,
    I'm trying to build an .exe from a VI that uses the factory pattern. The VI gives me the error that it can't find the classes to load and is looking outside the .exe file to find them. The specific error is:
    "Get LV Class Default Value.vi<APPEND>
    <b>Complete call chain:</b>
         Get LV Class Default Value.vi
         Main.vi
    <b>LabVIEW attempted to load the class at this path:</b>
    C:\ATE\Experiments\Build Testing\Builds\Virtual Classes\High Class\High Class.lvclass"
    I thought those classes were bundled into the .exe when it was built? I have included the class folders in the "Always Included" window of the build script.
    Any help would be appreciated. I'm fairly new to classes and I haven't built an .exe with an app using the factory pattern.
    Thanks,
    Simon
    Attachments:
    Build Testing.zip ‏491 KB

    This might be the answer.  I found the following checklist on Building Executables.  It really is referencing things other than Objects, but maybe Object folders also need to be properly located ...
    Bob Schor  [the stuff I found is below this line ...]
    Ensure paths generate correctly.
    Details
    If a VI loads other VIs dynamically using VI Server or calls a dynamically loaded VI through a Call By Reference node, make sure the application or source distribution creates the paths for the VIs correctly. To ensure paths generate correctly, use relative paths to load the VIs. The following table depicts the relative paths for a top-level VI, foo.vi, which calls a.vi and b.vi. C:\..\Application.exe represents the path to the application.
    Path to source files
    Path to files in application
    C:\Source\foo.vi
    C:\..\Application.exe\foo.vi
    C:\Source\xxx\a.vi
    C:\..\Application.exe\xxx\a.vi
    C:\Source\yyy\b.vi
    C:\..\Application.exe\yyy\b.vi
    If you use the LabVIEW 8.x file layout and you include dynamically loaded VIs in the application, the paths to the VIs change. For example, if you build b.vi into an application, its path is C:\..\Application.exe\b.vi whereC:\..\Application.exe represents the path to the application and its filename.

  • Placing a Low Level DB Function for Time Offset

    Would any one be able to point me to any documentation on the Oracle 10g R2 release that might help me understand if there is a way to modify datetime query parameters and datetime query results at a low level in the DB? R12 of Oracle Apps does not handle global implementations very well when it comes to running 24/7 with sites around the globe and handling data stored with a time element. Everything is stored using the single server time zone. So I thought perhaps there might be a way to modify the DB at a low level to perform the offset of the value for any datetime parameter to correspond to the proper server time zone to pull data and then to also offset the queried datetime values to the users, via a session value, time zone. So I am thinking long shot but perhaps there is a way to insert a function call to a function built in C and linked in to the DB somehow or the DB listener or the DB connection driver software. I don't know. I am familiar with OCI and SQLCA but don't believe these offer this type of interjection with the DB I am looking for. Of course, if there is a simple solution I am all for that.
    Thanks,
    Jason

    Adjusting the timezone at the session level doesn't do what I need it to do. At least based upon the tests I have done. And my research into changing the session DB time zone only applies to the new timestamp data types and not to the date data type.
    However, if you think that changing the DB session time zone setting would help do what I have stated please tell me.
    Thanks,
    Jason

  • CS6 Error message:  "A low-level exception occurred in: Blackmagic Design (recorder) "

    Hi,
    I have problem when install Adobe Pr Pro CS6 with DeckLink HD Extreme 3D
    My workstation have configuration as following:
    Supermicro workstation
    Super Micro x8DAL-i
    Intel Xeon E5645 2.40Ghz
    4GB DDR3-RAM x 2
    NVIDIA Quadro 2000 1GB Graphics
    250GB SATA 7200 RPM
    2TB 7200 RPM SATA x 2
    DVDRW
    Window 7 Pro 64bit
    I can capture with  Media Express but when I try to capture from CS6 with Decklink HD Extreme 3D,   the Error message:  “A low-level exception occurred in: Blackmagic Design (recorder) “
    Any one can help me urgent please
    Thank you,
    Dragonhn

    I have seen an issue with the latest Blackmagic driver and capturing with the current version of Premiere. I would use Media Express to capture and then just import the files.
    Eric
    ADK

  • A low level exception occured in: Importer MPEG (Importer)

    Okay, first some system specs:
    Macbook Pro
    2.2 GHz Intel Core i7
    8 GB RAM
    Radeon HD 6750
    OSX Lion 10.7.5
    Premiere Pro CS6 (updated to lastest available version)
    --I remember installing updates a few days ago (maybe last week), but don't remember if any of them were for Premiere and could possibly be the problem.
    The trouble I'm having is with one .MTS clip. I have a timeline about 20 minutes in length. I edited the whole thing and had no problems the whole time, with any clip. All clips originally imported correctly, played back fine, etc.
    I exported a copy for client review (from Media Encoder CS6) the other day. One clip (the .MTS clip in question) showed as "Media Offline". It is not offline, I did not move the clip, etc. I unlinked the clip in the project, relinked it, and it did show up in the project and was able to be played back.
    Exported another copy, found the same error occured with just this one clip. Now I'm noticing that when I open the project, I receive the error in the topic title (A low level exception occured in: Importer MPEG (Importer). The clip will not play back and shows up as "Media Pending", as if it's not coming in correctly. Unlinking and relinking doesn't fix the issue.
    I have many other .MTS clips in my timeline. All of them work correctly, play back correctly, and export correctly. There doesn't seem to be any inherent problem with the clip itself; it plays back smoothly in VLC, and I've transcoded it to a .mov to try and just bring that in and get around this stupid issue. This didn't work either; I unlink the clip, then relink to the transcoded .mov -- it actually will play back in the preview monitor, but will not display when trying to view it on my timeline. I have also created a copy of the project, tried this inside of the copy, as well as created a new sequence and pasted over the information; none of that worked either. There are also other sequences this clip is on, and it will not play back in any of them either, but as I mentioned, plays back in the preview.
    I did find one other topic with a similar issue; they recommend deactivating Premiere, restarting the computer, and activating it again. I did do a restart initially to try and diagnose the problem, but to no avail. I tried deactivating the program, but the Adobe Application Manager doesn't load; it has almost never loaded for me whenever I try to use it, which is frustrating in and of itself.
    I tried creating an entirely new project and importing the other project. When I did this Premiere just froze; I'm assuming it can't handle all the pieces (it's a fairly complex project with hundreds of clips) and they are also coming off an external drive through a USB 3.0 cable.
    I've temporarily "fixed" this by bringing in the transcoded clip, resyncing it to to the spot I need it in, and cutting it as necessary. I typed this post as I went and tried various things, and while I've found my way around the problem, it doesn't really solve it. I opened another old project that was very similar to this one and also encountered the same error message. I didn't stick around to find out if there was just one clip causing the issue; the fact that it was there was enough for me.
    So, what do I need to be doing here? I'm guessing the stock answer is to uninstall Premiere and reinstall it, which I don't want to do unless I have to since it's a pain in the ***. I'm kind of through the problem for this project, but want to be able to deal with it for the future. Hoping someone with knowledge can chime in and tell me whether it's the update from the other day causing this.
    If the answer is to uninstall and reinstall Premiere, do I need to run some cleaner tool? I vaguely remember hearing about that before in regards to uninstalling and reinstalling.

    I'm having the same issue here.
    Error: A low level exception occurred in: Importer MPEG (Importer)
    Anyone here who can help with this?
    Some Specs:
    MBP Retina, NVIDIA Gforce GT 750M, 16GB Ram, i7, G-RAID Thunderbolt (external media storage)
    Premiere CC 2014
    I'm working in a 1080p25 Timeline with Canon C300 footage (.MXF), normally it runs properly.

  • Low level code

    hi
    while configuring SNP planning run -SAPAPO/SNP01     screen under object selection >manual selection i could see planning version, product, location and low-level code....
    1. what is the significance of this parameter low level code ?
      2. how it reacts to the planning run ?
    my guess is that it takes into account all the tail end level of the BOM that belongs to the product ..but am not sure ..since it is 000/production server i dont want to experiment
    Please help me understand the science behind low level code,can you please suggest an easy to understand link or material
    thanks

    Hi Rahul,
    The low level code the position of a particular location product in a supply chain. SNP heuristics use it to determine the correct planning sequence. This is particular important if you are running "Location Heuristics" and putting the location products in the selection and want system to plan for only those location products.
    The system will use the low level code to determine which location product to plan first and then move to the next one and so on.
    You can refer the following links for further explanation.
    The Level of BOM Planning in the SNP Heuristic and Low Level Codes - SAP Planning
    Low-Level Code Determination - Supply Network Planning Run - SAP Library
    Regards,
    Mitesh

Maybe you are looking for

  • Remote Mac OS X Install is not presented in the list of startup disks

    Hey! I'm trying to install Snow Leopard to my macbook using remote DVD drive on my PC. Firstly I launched installer using Remote Disk from Finder. Istallation started, but then installer said that my Macintosh HD needs to be repaired and I have to us

  • CS6 Windows 8 64 bit Wont install acrobat x pro

    Hi, All of the other products in the suite install fine but this come up with an error log showing WARNING: DW066: OS requirements not met for {9E0AF030-AC6B-11E0-8837-00215AEA26C9} Microsoft Visual C++ 2010 Redistributable Package (x86) 10.0.40219.1

  • Pasted symbol from Illustrator becomes bitmap CS5

    I am working with Illustrator and Flash CS5.1 (working in AS2 document). I laid out a timeline in Illustrator and each timeline entry is a symbol with a line, the text for the entry, and a small document icon (also a symbol). I group those 3 items to

  • Keep getting Kernel Panics-have important work coming up-please help

    I am now in my 3rd reinstall of the OS this week. This time an Apple Genius did it at an Apple Store off their firewire drive. Every app and the OS is totally updated. My latest two Kernel Panics are listed below. It seems to always happen either whe

  • XSS Area not found

    All, I've created an overview and area page for ESS: Travel & Expense using the Homepage framework within IMG.  I was able to create and successfully test the configuration in DEV and it works perfectly.  I've since had the configuration transported