Best use of framework events in application architecture

Hello,
I apologize in advance if this is not the appropriate forum to be posting about Flex framework questions.  I considered the Cairngorm forum, but thought the question applied more broadly to all flex frameworks. That, and it seems that the Cairngorm forum isn't really very active.
My question is about using frameworks for application architecture. Reading the "Introducing Cairngorm" document,  I see that it specifically says that Cairngorm events are just those events that will handle business logic (things like grabbing data from a server, committing data to a server, etc).  So then, how does a view interact with a controller when changing state?
Let's say I have two or three different views of the same data and I have a buttonbar to switch to the view I want. Is it then typical to dispatch a Cairngorm (or Mate/Swiz/Pure MVC, etc..)  event to the controller to change the view state of the application?  Does this effectively mean that for every button a user can click on, we'll have an event and a command associated with that event to perform some change of state or business logic? With a moderately complicated application, with several different screens, a few forms, a couple of lookups, i.e. lots of buttons for user input, that seems like an awfully huge number of events/commands...? Or do you dispatch a regular old flash Event to handle this? Or does the view data bind to the model to change the view state?
Obviously there's never any single correct answer to application architecture questions, but I'd like to know if there's any general best practices that I should follow. I don't want to under-architect OR over-architect my app.  I'm new to Flex programming and would like not to code something egregiously ugly.
Thanks,
Cory

Hi,
Consider this, there is no such thing as an enterprise level RIA, the whole concept behind thin client was to restrict the enterprise requirements to the backend, that being said if we assume that a flex application is specifically for the client end and can maintain its own state and that MVC frameworks are more about enterprise solutions then the whole framework argument becomes what it is, academic BS.
<start rant>
Its really simply, in half a century nothing has changed, you have rules and requirements(model), you have access to that(view) and you wrap it up as a program/application(controller) so  why do you need convoluted multilayer abstraction of functionality to make things work ? maybe so those that can't get a real development job can run around and preach at conferences, how else could they feed their adopted kids.
So all those nice buzzwords, design patterns(the new age terminology for modular architecture), model/view/controller, borg coding(resistance is futile) is all very fine if you want to act smart but producing quality code actually means you are smart. As you may have guessed I am not a strong proponent of MVC frameworks, and I don't even need to get into the argument that everytime a 'framework' expert gets control of a project that isn't done in their MVC  poison of choice it gets a rewrite, clients really love those associated costs and retesting requirements.
</end rant>
You only need 1 framework for flex and thats the flex framework.
Have a read this blog, the section on MVC and Flex is very interesting if not overly polite.
http://www.herrodius.com/blog/216
David

Similar Messages

  • Advantages and disadvantages of using Caringorm Framework.

    Hi,
    I am new to Caringorm framework.. In our project we need to make discussion whether to use Caringorm framework or a simpler architecture(flex à servicesàServer side) to use
    Please let me know the advantages and disadvantages of using Caringorm framework from your experiences.
    Thanks in advance.

    hi,
    Data about an application object is often distributed on several tables. By defining a view, you can define an application-dependent view that combines this data. The structure of such a view is defined by specifying the tables and fields used in the view. Fields that are not required can be hidden, thereby minimizing interfaces. A view can be used in ABAP programs for data selection.
    More complicated views can comprise several base tables, the individual tables being linked with a relational join operation. If we dont specify the key fields, it takes time to fetch teh results.
    Regards,
    Sailaja.

  • What is the Best was to create a newsletter application using BEA / Documen

    Hi,
    I have some queries.
    What is the Best was to create a newsletter application using BEA / Documentum
    The newsletter will be republished and users will see new content every month. We plan to use BEA portal 8.1 sp3 with Documentum 5.3Sp1 / SCS.
    The content of newsletter may be coming from data sources, we will combine this content plus some static content, and publish to Documentum using BEA's CM SPI implementation for Documentum. To connect to different data sources we will use registered table feature of Documentum. Anybody can suggest the best to achieve this or any suggestion or any samples....
    How can we create our custom portlets which can use Documentum registered table feature to connect to data sources.
    Thanks for the help,
    Sudhir

    I assume that you are thinking about using the 'n" wireless version of the AirPort Express, or the "new" dual band AirPort Express.
    Simply connect each Express one at a time via Ethernet back to the Ethernet switch and use AirPort Setup to configure the device. Other than entering a device name for each Express, AirPort Setup will do everything else for you automatically. You will be amazed at how easy this will be.
    I do not want to use the "Extend Range" feature, as it trys to link the express back to the extreme via wireless.
    Sounds like you might be a bit confused here. When AirPort Setup recognizes that the Express is connected via Ethernet, it will configure the Express to "extend" using an Ethernet connection....not wireless.
    In other words, Apple devices can "extend" using wireless or Ethernet connections. AirPort Setup analyzes the connection and chooses the correct settings for you.
    If you later go back in and check the settings for the Express using AirPort Utility, you will see that it has actually been set up to "create" a wireless network using the same wireless network name, same security and same password as the main router. The Express will also be in Bridge Mode to work correctly on the network.

  • Entity Framework in WPF Application - Using Statement or Implement IDisposable

    I have a WPF application that uses Entity Framework.
    I have implemented a Repository that implements IDisposable, that holds my EF context.  When the application starts up I new up a Repository, which news up an EF context, then when the application shuts down, I dispose of my Repository, which disposes
    the EF context as well.
    The end result is that my context remains open during the entire lifetime of the application.  
    I've been reading up on EF, and all the examples put the operations against the EF context in a using statement.  Is that the preferred approach?  What is the priority: to keep the context open briefly, or just to make sure you properly dispose
    of it when you're finished with it.
    Thanks.
    Aaron

    >
    https://msdn.microsoft.com/en-us/library/aa355056(v=vs.110).aspx
    That link is only for WCF and it's broken implementation of the Dispose pattern.
    >I have been burnt in doing it where the connection was not closed or disposed when it short-circuted out of the Using statement on exception
    If so, it was a bug.  You should expect that not to happen.
    'using' will close your connection, unless the connection was open before the DbContext and was passed in.  'using' is the safest way to ensure that the connections are closed in a timely manner.
    David
    David http://blogs.msdn.com/b/dbrowne/
    I absoultly do not agree with you. I have been burnt in using the Using statment. And it was along the lines that an excpetion was thrown within the Using statement and no closing of the connection or dispoiong of it ever occured, which is what the WCF example
    is showing on how a Using statement can be short-circuted and things can go wrong.
    I don't care if the Using statement issue is being shown on a WCF typed cleint. I do the same thing in using straight up ADO.NET or EF, becuase I have been burnt by the Using statement, and I dont use them to open,  close or dispose of a connection.

  • Using an iCal Event to Close an Application

    i want to schedule the closing of an application. My internet provider gives me unlimited download at night so i want to do my downloading between certain hours every day. I have scheduld itunes to open and at 2300 each night but i then want it to close at 0800 the next day. Apart from gliches in Mavericks getting the schedule to start the task there appears no way to close an app using iCal.
    Any suggestions?

    Open the AppleScript editor in Applications>Utilities. Copy the following into it
    tell application "iTunes" to quit
    Save it as a script and place it somewhere convenient.
    Set your event in iCal and set an alarm, choosing 'Run script'. Select the script you just created. (I assume all this is the same in Mavericks as earlier systems). However if iTunes is in the process of downloading at the time you will get a warning message so you should probably add the following:
    delay (1)
    tell application "System Events"
      tell application "iTunes" to activate
      keystroke return
    end tell
    I should make sure that the Finder was frontmost when starting iTunes so that a spurious return won't matter.

  • Using EJBs in Web Dynpro Applications

    I have recently started to develop Web applications using the Web Dynpro framework. Coming from a pure J2EE world, I must admit that Web Dynpro has a few innovative features that I find interesting for user interface development. The use of component & view contexts, for example, is not unlike the ActionForms that one may find in a Struts application, but pushed a bit further. No complaints here.
    What I do have some problems with is the whole CommandBean paradigm that is put forth by SAP (refer to the document <a href="https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webdynpro/using%20ejbs%20in%20web%20dynpro%20applications.pdf">Using EJBs in Web Dynpro Applications</a>).
    I do understand the usefulness of defining a model that will be used to generate and eventually bind to Context data structures. That's fine. What I do object to is the use of a so-called CommandBean to play that role. Again, coming from a J2EE world, I am familiar with the BusinessDelegate pattern - which would typically be used by a client application to invoke business logic on the server side. I would propose that a better, cleaner way of integrating EJBs with the Web Dynpro framework would be to use a BusinessDelegate for invoking business logic, and importing a separate and distinct ModelBean (instead of a CommandBean) to be used for defining and binding to Context data.
    I have built one Web Dynpro application thus far. Instead of using a CommandBean, I created a ModelBean that extends my business object DTO (Data Transfer Object) (which is quite appropriate for that role, given that it implements all the get & set methods that are required for the business data that I need to model). My Web Dynpro application also makes use of an independant BusinessDelegate that is packaged with my EJB DC - this is a standard best practice on J2EE projects. I have been asked by the people working with me to modify this architecture to bring it more in line with the SAP way of doing things. I am open-minded and willing to learn and accept new ways of thinking and doing things. However, I fail to understand the usefulness of merging structure and behaviour by resorting to CommandBeans:
    - <b>It violates the MVC paradigm</b> by having one object (the CommandBean) serve as both model AND controller as far as the Web Dynpro application is concerned. The CommandBean is obviously a model - since it is literally imported as such into the Web Dynpro application. It is ALSO a controller from the Web Dynpro's application perspective, since all calls to the back-end go thru the CommandBean via one or more of its execute_xxx methods. In contrast, the use of a business delegate by the Web Dynpro application clearly separates the model (the CommandBean... or rather, a more suitably named ModelBean) from the controller (BusinessDelegate).
    - <b>Doesn't carry its own weight</b>. In other words, I haven't yet been provided with any valid justification for going thru the extra effort of coding the CommandBean's execute methods. It's been proposed to me that it somehow serves as an abstraction layer between the Web Dynpro application and the business logic. I would argue that it is the BusinessDelegate's role to abstract away the back-end logic from clients. If one does have a BusinessDelegate available, I would argue there's no need to code execute methods in a separate CommandBean. To prove my point, I would simply point out that all of the CommandBean examples that I have seen so far, either in How-To documents, or in production code, all follow the same pattern....
    CommandBean.execute_doSomething() calls BusinessDelegate.doSomething()
    Not a heck of an "abstraction" layer... I would in fact argue that it is worse than useless. If some major change occurs in the business logic that requires changing the doSomething() operation, we expect of course to modify the BusinessDelegate. The Web Dynpro client will also presumably need to be modified - that's to be expected, and unavoidable. But then, we'll also need to go about and change the CommandBean's execute_doSomething() method - again, extra work for no apparent benefit. Adding and removing business methods has the same implication. All this for an layer that simply adds the prefix execute_ in front of all business method calls... Is this "abstraction layer" worth the cost of creating and maintaining it ??
    - <b>Unnecessarily complicates error handling</b>. I have been told that for technical reasons, it is recommended that all exceptions thrown by the CommandBean be of type WDException or WDRuntimException. But what if the client application needs to react differently to different failure scenarios ? When I create a business object, I might wish to provide the user with an error messages if connection is lost to the backend, and with a different error message if an object already exists in the database with the same attributes. In order to do that, I will have to catch the WDException, extract the cause, and continue processing from there... possible, yes, but clearly less standard and more labor intensive than the classical try/catch mechanism.
    To say nothing about the fact that SAP's own API documentation clearly states that applications using Web Dynpro can reference and catch WDExceptions, but THEY MUST NOT THROW OR EXTEND IT !
    - <b>Produces unnecessary DCs</b>. Page 6 of the aforementioned document presents an architectural view of a Web Dynpro project that uses a CommandBean. Why an extra DC for the CommandBean ?? I created my ModelBean class right inside the Web Dynpro project (in the Package view). That, to me, is where this class should reside, because it is created for no other reason that to be used by this particular Web Dynpro application. What is the benefit of placing it in its own independant DC ?
    - <b>Not a typical application of the Command pattern</b>. The well-documented command pattern (Design Patterns - Gang of Four) has been devised mainly to enable encapsulation of request as objects, thereby making it possible to:
    - specify, queue and execute requests at different times
    - decouple execution of a command from its invoker
    - support undo operations
    - support logging changes so that they can be reapplied in case of system crash making it possible to assemble commands into composite commands (macros), thereby structuring a system around high-level operations built on primitive operations.
    None of this applies to the way the SAP CommandBeans are being used. Not that much of an issue to people new to J2EE and/or OO development... but quite confusing for those already familiar with the classic Command pattern.
    At this point, I fail to understand the advantage of merging structure (model) and behaviour (execute methods) through the use of a unique CommandBean object. Am I missing something ?

    Hi Romeo,
    You would be disappointed, this reply ain't anywhere nearby to what you are talking about...
    I wanted to mail you, but you have not mentioned your email in your profile.
    I am really impressed by your flair for writing. It would be far better had you written a blog on this topic. Believe me, it would really be better. There is a much wider audience waiting out there to read your views rather than on the forums. This is what I believe. To top it, you would be rewarded for writing something like this from SDN. On the blogs too, people can comment and all, difference being there you would be rewarded by SDN, here people who reply to you would be rewarded by you. Doesn't make  much a difference.
    Anyways the ball is still in your court
    As far as I am concerned, it has still not been much time since I have started working on Web Dynpro. So can't really comment on the issue...
    Bye
    Ankur

  • Best use of a model in cairngorm

    I am a little confused about the use of a model , ModelLocator, in cairngorm
    I have it created and it all works fine but whats the best way to access it, Currently i have numerous forms that all do something like
        <fx:Script>
            <![CDATA[
                import com.model.ModelLocator;
                [Bindable] private var model:ModelLocator = ModelLocator.getInstance();
    and then later on
                private function fun1(evt:Event):void
                   model.something = "blah"
                   var s1:String = model.anotherSomething;
    or whatever
    Is it ok to have varibles all over the place in different mxml files all creating a private var model, does this comsume resouces or is it ok because its static
    Also i have several arrayCollections 11+ , plus other stuff in the model, is this ok

    Hi JockMahon,
    Its ok fine you can go with that..
    However remember one thing you will be declaring any variables in the ModelLocator class only if you are using them through out your application .. I mean more than one mxml page or AS files. However if you require any property or variable only within a single file then you can declare it locally within the file instead of decalring it in
    ModelLocator.
    The ModelLocator class in cairngorm framework is a singleton class so in how many files you have a model variable it will actually refer or return only single static instance of the ModelLocator class.
    [Bindable] private var model:ModelLocator = ModelLocator.getInstance();
    So how many times you have a variable by using the above style of decalring you will only get a single static reference to the instance of ModelLocator class. No ne instances are created. Its like you get a pointer to the model variable.
    Hope it is clear now.
    Thanks,
    Bhasker

  • Error in Jdeveloper using WebCenter Framework

    Hi All,
    I am creating a sample application using webcenter framework in Jdeveloper. As i have installed the extensions of webcenter from HELP->Check For Updates -> webcenter extension. It was working fine but when i am trying to create the connection to content repository from Application Resources i am getting following error in Jdeveloper:-
    An unexpected severe error has occurred in Jdeveloper and in error details the log was:-
    oracle.classloader.util.AnnotatedNoClassDefFoundError:
    Missing class: javax.jcr.Repository
    *     Dependent class: oracle.vcr.jam.JamRepository*
    *     Loader: ide-global:11.1.1.0.0*
    *     Code-Source: /E:/Oracle/Middleware/jdeveloper/webcenter/modules/oracle.webcenter.framework_11.1.1/jcr-manager.jar*
    *     Configuration: <classpath> in /file:/E:/Oracle/Middleware/jdeveloper/jdev/extensions/oracle.webcenter.content.dt.jar!/META-INF/extension.xml*
    The missing class is not available from any code-source or loader in the system.
    o.classloader.PolicyClassLoader.defineClass(PolicyClassLoader.java:2387)
    o.classloader.PolicyClassLoader.findLocalClass(PolicyClassLoader.java:1546)
    o.classloader.SearchPolicy$FindLocal.getClass(SearchPolicy.java:226)
    o.classloader.SearchSequence.getClass(SearchSequence.java:119)
    o.classloader.PolicyClassLoader.internalLoadClass(PolicyClassLoader.java:1728)
    o.classloader.PolicyClassLoader.access$000(PolicyClassLoader.java:143)
    o.classloader.PolicyClassLoader$LoadClassAction.run(PolicyClassLoader.java:331)
    j.security.AccessController.doPrivileged(Native Method)
    o.classloader.PolicyClassLoader.loadClass(PolicyClassLoader.java:1692)
    o.classloader.PolicyClassLoader.loadClass(PolicyClassLoader.java:1674)
    o.webcenter.internal.dt.config.ConnectionContextListener.<clinit>(ConnectionContextListener.java:81)
    o.webcenter.internal.dt.addin.WebCenterFrameworkAddin$1.rescatContextRegistered(WebCenterFrameworkAddin.java:237)
    o.j.rescat2.RescatContextRegistry.notifyContextRegistered(RescatContextRegistry.java:328)
    o.j.rescat2.RescatContextRegistry.registerContext(RescatContextRegistry.java:93)
    o.adf.share.dt.AppConnContext.getRescatContext(AppConnContext.java:221)
    o.adf.share.dt.ApplicationConnectionsNode.applicationChanged(ApplicationConnectionsNode.java:94)
    o.j.appresources.ApplicationResourcesWindow.notifyApplicationChanged(ApplicationResourcesWindow.java:298)
    o.j.appresources.ApplicationResourcesNode.applicationChanged(ApplicationResourcesNode.java:66)
    o.j.appresources.ApplicationResourcesWindow.applicationChanged(ApplicationResourcesWindow.java:236)
    o.i.navigator.ApplicationNavigatorWindow.fireApplicationChangeEventImpl(ApplicationNavigatorWindow.java:990)
    o.i.navigator.ApplicationNavigatorWindow.fireApplicationChangeEvent(ApplicationNavigatorWindow.java:974)
    o.i.navigator.ApplicationNavigatorWindow.access$200(ApplicationNavigatorWindow.java:100)
    o.i.navigator.ApplicationNavigatorWindow$1L.itemStateChanged(ApplicationNavigatorWindow.java:263)
    jx.s.JComboBox.fireItemStateChanged(JComboBox.java:1205)
    jx.s.JComboBox.selectedItemChanged(JComboBox.java:1262)
    jx.s.JComboBox.contentsChanged(JComboBox.java:1309)
    jx.s.AbstractListModel.fireContentsChanged(AbstractListModel.java:100)
    jx.s.DefaultComboBoxModel.setSelectedItem(DefaultComboBoxModel.java:88)
    jx.s.JComboBox.setSelectedItem(JComboBox.java:557)
    jx.s.JComboBox.setSelectedIndex(JComboBox.java:603)
    o.i.navigator.ApplicationNavigatorWindow.initSelectedApplication(ApplicationNavigatorWindow.java:1135)
    o.i.navigator.ApplicationNavigatorWindow.initToolbarArea(ApplicationNavigatorWindow.java:1035)
    o.ideri.navigator.DefaultNavigatorWindow.initCommonItems(DefaultNavigatorWindow.java:384)
    o.i.navigator.ApplicationNavigatorWindow.getGUI(ApplicationNavigatorWindow.java:695)
    o.i.docking.DockableWindow.getHostedComponent(DockableWindow.java:231)
    o.ii.docking.TitledPanelHolder.getOrCreateComponent(TitledPanelHolder.java:47)
    o.ii.docking.TitledPanel.setPageVisible(TitledPanel.java:881)
    o.ii.docking.TitledPanel.showClient(TitledPanel.java:858)
    o.ii.docking.TitledPanel.setClientVisible(TitledPanel.java:841)
    o.ii.docking.TitledPanel.setClientVisible(TitledPanel.java:819)
    o.ii.docking.TitledPanel.loadVisibilityLayout(TitledPanel.java:1789)
    o.ii.docking.DockPanel.loadVisibilityLayout(DockPanel.java:200)
    o.ii.docking.AbstractDockPanelHost.loadVisibilityLayout(AbstractDockPanelHost.java:94)
    o.ii.docking.DockStationImpl.onStartup(DockStationImpl.java:1634)
    o.ii.docking.DockStationImpl.loadLayout(DockStationImpl.java:1473)
    o.ii.docking.DockStationListener.init(DockStationListener.java:36)
    o.i.layout.Layouts.activate(Layouts.java:812)
    o.i.layout.Layouts.activateLayout(Layouts.java:192)
    o.ii.MainWindowImpl$6.runImpl(MainWindowImpl.java:728)
    o.javatools.util.SwingClosure$1Closure.run(SwingClosure.java:50)
    j.a.event.InvocationEvent.dispatch(InvocationEvent.java:199)
    j.a.EventQueue.dispatchEvent(EventQueue.java:597)
    j.a.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
    j.a.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
    j.a.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
    j.a.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
    j.a.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
    j.a.EventDispatchThread.run(EventDispatchThread.java:122)
    Please Help!!!
    Thanks..

    http://puchaanirudh.blogspot.com/2008/04/oracleclassloaderutilannotatednoclassde.html
    For jdeveloper errors.
    I think all the required jars are not loaded during the installation.
    I advice you , to download the jdeveloper again and update the webcenter files.

  • ADF Application Architecture

    Hi All,
    I am new to ADF and working with some vendor to transform our in-house Oracle Form Application to ADF Application and we have more than 300 Oracle Forms to translate.
    Basically after the login page, we will have a main menu, and then from the main menu, user can access to different modules (e.g. Customer Profile / Supplier Profile / Order Processing etc..). One of the critical point is that there will different shared variable pass from the main menu to each module and from each module back to the main menu.
    We have successfully translate a few Oracle Form to ADF JSF Application. However, before continue the project, we would like to confirm the application architecture.
    Checking on Oracle Website / different ADF forum, basically they will packaging all their ADF program in 2 different approach.
    Approach (1):
    i) Create a common workspace which put all the common EO, VO, AM, Task Flow Template, Page Template, Skin, etc and export as an ADF Library
    ii) Create different Bounded Task Flow Workspace with its corresponding Model and View Controller for different modules (e.g. Customer Profile / Supplier Profile / Order Processing etc..) and then export as an ADF Library
    iii) Create a master workspace with View Controller to contains an Unbounded Task Flow to tier all the different modules together as an EAR file.
    Approach (2)
    i) Create a common workspace which put all the common EO, VO, AM, Task Flow Template, Page Template, Skin, etc and export as an ADF Library
    ii) Create different workspace with its corresponding Model and View Controller for different modules (e.g. Main Menu / Customer Profile / Supplier Profile / Order Processing etc..) and then export as an EAR file
    From Approach (2), when I need to pass parameter from Main Menu to Customer Profile, since they are from different application, I can only pass it through URL or database. But it seems to be not a very approach. May I know is there other way to passing parameter between different ADF Application ?
    From Approach (1), it seems that the parameter can be passed using the bean since they are under one master workspace. However, from some of the forum said, if there is too many modules (my case is ~ 300 modules, there will be a problem on the CPU, RAM and JVM may not be able to start.
    May I know is it correct from my assumption ? Also may I know which approach should I use ? Thanks !!
    Best Regards,
    Eric

    Hi Timo,
    Thanks for your reply. Yes I have watch the ADF Architecture TV Episode too. But I still cannot figured out which approach I should using. From the video, it said that sum of the parts may risk from the start up of JVM when you have too many application. Pillar architecture can solve that problem however parameter may need to pass through different ADF application since they are compiled as different EAR file. But passing the parameter through URL / database package seems not an excellent idea.
    Moreover, since all those ~300 modules are different and may not related from each other, so it may not be a suitable case to put multiple forms into one ADF application in my case. Also our system have frequently change request from the user and those request are usually handled by different developer. So I guess it may be better to put it in different ADF application instead of putting in a single one.
    Any advice ?  Thanks !
    Eric

  • Using Entity Framework with SQL Azure - Reliability

    (This is a cross post from http://stackoverflow.com/questions/5860510/using-entity-framework-with-sql-azure-reliability since I have yet to receive any replies there)
    I'm writing an application for Windows Azure. I'm using Entity Framework to access SQL Azure. Due to throttling and other mechanisms in SQL Azure, I need to make sure that my code performs retries if an SQL statement has failed. I'm trying to come up with
    a solid method to do this.
    (In the code below, ObjectSet returns my EFContext.CreateObjectSet())
    Let's say I have a function like this:
      public Product GetProductFromDB(int productID)
         return ObjectSet.Where(item => item.Id = productID).SingleOrDefault();
    Now, this function performs no retries and will fail sooner or later in SQL Azure. A naive workaround would be to do something like this:
      public Product GetProductFromDB(int productID)
         for (int i = 0; i < 3; i++)
            try
               return ObjectSet.Where(item => item.Id = productID).SingleOrDefault();
            catch
    Of course, this has several drawbacks. I will retry regardless of SQL failure (retry is waste of time if it's a primary key violation for instance), I will retry immediately without any pause and so on.
    My next step was to start using the Transient Fault Handling library from Microsoft. It contains RetryPolicy which allows me to separate the retry logic from the actual querying code:
      public Product GetProductFromDB(int productID)
         var retryPolicy = new RetryPolicy<SqlAzureTransientErrorDetectionStrategy>(5);
         var result = _retryPolicy.ExecuteAction(() =>
               return ObjectSet.Where(item => item.Id = productID).SingleOrDefault;
         return result;
    The latest solution above is described as ahttp://blogs.msdn.com/b/appfabriccat/archive/2010/10/28/best-practices-for-handling-transient-conditions-in-sql-azure-client-applications.aspx Best Practices for Handling Transient Conditions in SQL Azure Client
    Application (Advanced Usage Patterns section).
    While this is a step forward, I still have to remember to use the RetryPolicy class whenever I want to access the database via Entity Framework. In a team of several persons, this is a thing which is easy to miss. Also, the code above is a bit messy in my
    opinion.
    What I would like is a way to enforce that retries are always used, all the time. The Transient Fault Handling library contains a class called ReliableSQLConnection but I can't find a way to use this with Entity Framework.
    Any good suggestions to this issue?

    Maybe some usefull posts
    http://blogs.msdn.com/b/appfabriccat/archive/2010/12/11/sql-azure-and-entity-framework-connection-fault-handling.aspx
    http://geekswithblogs.net/iupdateable/archive/2009/11/23/sql-azure-and-entity-framework-sessions-from-pdc-2009.aspx

  • Using AIA to jump start application integration platform for custom apps

    Has anyone used AIA Foundation Packs as the core application integration framework for integrating custom developed applications?
    My company has Oracle / PSft ERP applications, but I'm wondering if there is value in exploring the Oracle AIA Foundation Packs to help standardize / implement application and data integration solutions between our custom applications. Most of our application architecture portfolio are custom apps on legacy Oracle Forms platform and Oracle ADF; Oracle Java rich client (EJB / Swing) applications.
    R

    Hi R,
    There are many AIA customers doing exactly the same. The value of standardizing the complete integration portfolio is very apparent and AIA Foundation pack provides you complete set of tools to achieve it.
    Regards
    Rohit

  • Error using Search Taskflow in Portal Application

    Hi,
    I am facing an error while using the Search Taskflow in Webcenter Portal Framework Application.
    When I search for a keyword using Search Toolbar , I get the results in the Search Results page. But when I try to search for another keyword in the Search Results page using the search space, I get an error "Object name oracle_webcenter_search_view_jsf_fragments_searchResultsFragmentPageDef_oracle_webcenter_search_controller_taskflows_searchResults_xml_search_view of type Iterator Binding Definition is invalid."
    I checked the logs and got the below information.
    "ADF: Adding the following JSF error message: Object name oracle_webcenter_search_view_jsf_fragments_searchResultsFragmentPageDef_oracle_webcenter_search_controller_taskflows_searchResults_xml_search_view of type Iterator Binding Definition is invalid.[[
    oracle.jbo.InvalidObjNameException: JBO-25005: Object name oracle_webcenter_search_view_jsf_fragments_searchResultsFragmentPageDef_oracle_webcenter_search_controller_taskflows_searchResults_xml_search_view of type Iterator Binding Definition is invalid.
         at oracle.adf.model.binding.DCBindingContainerState.validateStateFromString(DCBindingContainerState.java:573)
         at oracle.adf.model.binding.DCBindingContainerState.validateStateFromString(DCBindingContainerState.java:550)
         at oracle.adf.model.binding.DCBindingContainerState.validateStateFromString(DCBindingContainerState.java:550)
         at oracle.adf.model.binding.DCBindingContainerState.validateStateFromString(DCBindingContainerState.java:504)
         at oracle.adf.model.binding.DCBindingContainerState.validateToken(DCBindingContainerState.java:683)
         at oracle.adf.model.binding.DCBindingContainer.validateToken(DCBindingContainer.java:5048)
         at oracle.adf.controller.v2.lifecycle.PageLifecycleImpl.prepareModel(PageLifecycleImpl.java:120)
         at oracle.adf.controller.faces.lifecycle.FacesPageLifecycle.prepareModel(FacesPageLifecycle.java:359)
         at oracle.adf.controller.v2.lifecycle.Lifecycle$2.execute(Lifecycle.java:137)
         at oracle.adfinternal.controller.lifecycle.LifecycleImpl.executePhase(LifecycleImpl.java:197)
         at oracle.adfinternal.controller.faces.lifecycle.ADFPhaseListener.access$400(ADFPhaseListener.java:23)
         at oracle.adfinternal.controller.faces.lifecycle.ADFPhaseListener$PhaseInvokerImpl.startPageLifecycle(ADFPhaseListener.java:238)
         at oracle.adfinternal.controller.faces.lifecycle.ADFPhaseListener$1.after(ADFPhaseListener.java:274)
         at oracle.adfinternal.controller.faces.lifecycle.ADFPhaseListener.afterPhase(ADFPhaseListener.java:75)
         at oracle.adfinternal.controller.faces.lifecycle.ADFLifecyclePhaseListener.afterPhase(ADFLifecyclePhaseListener.java:53)
         at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._executePhase(LifecycleImpl.java:472)
         at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:194)
         at javax.faces.webapp.FacesServlet.service(FacesServlet.java:265)
         at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
         at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
         at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:301)
         at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at oracle.portlet.client.adapter.adf.ADFPortletFilter.doFilter(ADFPortletFilter.java:32)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at oracle.webcenter.framework.events.dispatcher.EventDispatcherFilter.doFilter(EventDispatcherFilter.java:44)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at oracle.adf.model.servlet.ADFBindingFilter.doFilter(ADFBindingFilter.java:205)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at oracle.adfinternal.view.faces.webapp.rich.RegistrationFilter.doFilter(RegistrationFilter.java:106)
         at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:446)
         at oracle.adfinternal.view.faces.activedata.AdsFilter.doFilter(AdsFilter.java:60)
         at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:446)
         at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._doFilterImpl(TrinidadFilterImpl.java:271)
         at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl.doFilter(TrinidadFilterImpl.java:177)
         at org.apache.myfaces.trinidad.webapp.TrinidadFilter.doFilter(TrinidadFilter.java:92)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at oracle.wcps.client.PersonalizationFilter.doFilter(PersonalizationFilter.java:75)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at oracle.webcenter.content.integration.servlets.ContentServletFilter.doFilter(ContentServletFilter.java:168)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at oracle.webcenter.lifecycle.filter.LifecycleLockFilter.doFilter(LifecycleLockFilter.java:151)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at oracle.adf.library.webapp.LibraryFilter.doFilter(LibraryFilter.java:179)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at oracle.security.jps.ee.http.JpsAbsFilter$1.run(JpsAbsFilter.java:119)
         at java.security.AccessController.doPrivileged(Native Method)
         at oracle.security.jps.util.JpsSubject.doAsPrivileged(JpsSubject.java:315)
         at oracle.security.jps.ee.util.JpsPlatformUtil.runJaasMode(JpsPlatformUtil.java:442)
         at oracle.security.jps.ee.http.JpsAbsFilter.runJaasMode(JpsAbsFilter.java:103)
         at oracle.security.jps.ee.http.JpsAbsFilter.doFilter(JpsAbsFilter.java:171)
         at oracle.security.jps.ee.http.JpsFilter.doFilter(JpsFilter.java:71)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at oracle.dms.servlet.DMSServletFilter.doFilter(DMSServletFilter.java:139)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsFilter.java:27)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3730)
         at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3696)
         at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
         at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
         at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2273)
         at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2179)
         at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1490)
         at weblogic.work.ExecuteThread.execute(ExecuteThread.java:256)
         at weblogic.work.ExecuteThread.run(ExecuteThread.java:221)
    I am unable to understand the error. Can someone throw some light on it? :(
    regards,
    Anush

    Hi,
    I am facing an error while using the Search Taskflow in Webcenter Portal Framework Application.
    When I search for a keyword using Search Toolbar , I get the results in the Search Results page. But when I try to search for another keyword in the Search Results page using the search space, I get an error "Object name oracle_webcenter_search_view_jsf_fragments_searchResultsFragmentPageDef_oracle_webcenter_search_controller_taskflows_searchResults_xml_search_view of type Iterator Binding Definition is invalid."
    I checked the logs and got the below information.
    "ADF: Adding the following JSF error message: Object name oracle_webcenter_search_view_jsf_fragments_searchResultsFragmentPageDef_oracle_webcenter_search_controller_taskflows_searchResults_xml_search_view of type Iterator Binding Definition is invalid.[[
    oracle.jbo.InvalidObjNameException: JBO-25005: Object name oracle_webcenter_search_view_jsf_fragments_searchResultsFragmentPageDef_oracle_webcenter_search_controller_taskflows_searchResults_xml_search_view of type Iterator Binding Definition is invalid.
         at oracle.adf.model.binding.DCBindingContainerState.validateStateFromString(DCBindingContainerState.java:573)
         at oracle.adf.model.binding.DCBindingContainerState.validateStateFromString(DCBindingContainerState.java:550)
         at oracle.adf.model.binding.DCBindingContainerState.validateStateFromString(DCBindingContainerState.java:550)
         at oracle.adf.model.binding.DCBindingContainerState.validateStateFromString(DCBindingContainerState.java:504)
         at oracle.adf.model.binding.DCBindingContainerState.validateToken(DCBindingContainerState.java:683)
         at oracle.adf.model.binding.DCBindingContainer.validateToken(DCBindingContainer.java:5048)
         at oracle.adf.controller.v2.lifecycle.PageLifecycleImpl.prepareModel(PageLifecycleImpl.java:120)
         at oracle.adf.controller.faces.lifecycle.FacesPageLifecycle.prepareModel(FacesPageLifecycle.java:359)
         at oracle.adf.controller.v2.lifecycle.Lifecycle$2.execute(Lifecycle.java:137)
         at oracle.adfinternal.controller.lifecycle.LifecycleImpl.executePhase(LifecycleImpl.java:197)
         at oracle.adfinternal.controller.faces.lifecycle.ADFPhaseListener.access$400(ADFPhaseListener.java:23)
         at oracle.adfinternal.controller.faces.lifecycle.ADFPhaseListener$PhaseInvokerImpl.startPageLifecycle(ADFPhaseListener.java:238)
         at oracle.adfinternal.controller.faces.lifecycle.ADFPhaseListener$1.after(ADFPhaseListener.java:274)
         at oracle.adfinternal.controller.faces.lifecycle.ADFPhaseListener.afterPhase(ADFPhaseListener.java:75)
         at oracle.adfinternal.controller.faces.lifecycle.ADFLifecyclePhaseListener.afterPhase(ADFLifecyclePhaseListener.java:53)
         at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._executePhase(LifecycleImpl.java:472)
         at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:194)
         at javax.faces.webapp.FacesServlet.service(FacesServlet.java:265)
         at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
         at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
         at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:301)
         at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at oracle.portlet.client.adapter.adf.ADFPortletFilter.doFilter(ADFPortletFilter.java:32)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at oracle.webcenter.framework.events.dispatcher.EventDispatcherFilter.doFilter(EventDispatcherFilter.java:44)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at oracle.adf.model.servlet.ADFBindingFilter.doFilter(ADFBindingFilter.java:205)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at oracle.adfinternal.view.faces.webapp.rich.RegistrationFilter.doFilter(RegistrationFilter.java:106)
         at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:446)
         at oracle.adfinternal.view.faces.activedata.AdsFilter.doFilter(AdsFilter.java:60)
         at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:446)
         at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._doFilterImpl(TrinidadFilterImpl.java:271)
         at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl.doFilter(TrinidadFilterImpl.java:177)
         at org.apache.myfaces.trinidad.webapp.TrinidadFilter.doFilter(TrinidadFilter.java:92)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at oracle.wcps.client.PersonalizationFilter.doFilter(PersonalizationFilter.java:75)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at oracle.webcenter.content.integration.servlets.ContentServletFilter.doFilter(ContentServletFilter.java:168)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at oracle.webcenter.lifecycle.filter.LifecycleLockFilter.doFilter(LifecycleLockFilter.java:151)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at oracle.adf.library.webapp.LibraryFilter.doFilter(LibraryFilter.java:179)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at oracle.security.jps.ee.http.JpsAbsFilter$1.run(JpsAbsFilter.java:119)
         at java.security.AccessController.doPrivileged(Native Method)
         at oracle.security.jps.util.JpsSubject.doAsPrivileged(JpsSubject.java:315)
         at oracle.security.jps.ee.util.JpsPlatformUtil.runJaasMode(JpsPlatformUtil.java:442)
         at oracle.security.jps.ee.http.JpsAbsFilter.runJaasMode(JpsAbsFilter.java:103)
         at oracle.security.jps.ee.http.JpsAbsFilter.doFilter(JpsAbsFilter.java:171)
         at oracle.security.jps.ee.http.JpsFilter.doFilter(JpsFilter.java:71)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at oracle.dms.servlet.DMSServletFilter.doFilter(DMSServletFilter.java:139)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsFilter.java:27)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3730)
         at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3696)
         at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
         at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
         at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2273)
         at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2179)
         at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1490)
         at weblogic.work.ExecuteThread.execute(ExecuteThread.java:256)
         at weblogic.work.ExecuteThread.run(ExecuteThread.java:221)
    I am unable to understand the error. Can someone throw some light on it? :(
    regards,
    Anush

  • Maintaining page stack using BC4J framework

    We are developing a web application using JDeveloper(using bc4j+struts) in which list of functions are available in the tree menu on the left side. On clicking any function three tabs are displayed in the main body which are search, result list and maintenance. Now let's say user did some search on function A by entering some criterias and clicking the search button and output is shown in the result tab. Now user goes to another function B and does some operation. Now the requirement is that when the user returns to function A the previously set search criteria should remain. This is required for all functions. Without persiting in the web tier (HttpSession) what is the best way to do this using BC4J framework. Should I design View Objects with all transient attributes for each of the screens and use the application module in stateful mode? What can be the best and generic way to solve this?
    Note that we will have several combos (LOV) which are themselves mapped to a view object in the search page.

    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by JDev Team (Laura):
    Which version of JDeveloper are you using?<HR></BLOCKQUOTE>
    I'm using JDeveloper 3.1 .
    Please could you check with the developer if it's bug or not and if there is some fix to this (plans?).
    TIA,
    Seb.
    null

  • [b]Events Managment Application[/b]

    Hi All,
    I’m working on an events management application. The purpose of this application is to handle multipurpose events organized by my organization. Not sure what is the best practice to handle the following
    1-     On-line registration will be allowed for selected organization, therefore we would like to create user id and password for each organization and send it to them by e-mail an organization could register one or more of their employees I want them to be able to add or update their information
    2-     I want to allow the users to be able to upload personal photo and a copy of their passport for visa purposes.
    3-     I want to notify them by e-mail (automatically) when they successfully register.
    4-     Is it a better practice to write to live data or to a separate table and then update my database.
    I’m looking for experts opinion in the above questions.
    I’m using APEX 3.01
    Regards,
    Ribhi

    Hi Dan,
    Thank you for your prompt response. To answer your questions
    1 – The major event is an annual meeting of 5 Arab financial organization, people invited for this event are governors and head of departments of participating countries the number usually between 400 – 500 participants. Currently we have a form which we send to organizations 2 months before meetings, received information is re-entered in an access database.
    2- Not sure what is SSO products, OID, AD .
    3- I would like to learn more about current mail package, I’m not gonna use any attachments for this time
    4- Regarding live data my question was is it better to create a separate database where the registration information will be written or write on the production database directly.
    Regards,
    Ribhi

  • How to organize  project structure  for big application architecture

    Hi all:
    We prepare to construct a medium erp project using JHeadstart,
    so we have some application system like human resource, accounting, inventory, ...
    What's the best suite to organize application project architecture ?
    we have this issue about application architecture:
    1.how to fulfill large scale application and must to share some common view object and entity object in all application, May we to break the application down into multiple BC4J packae in same project or separate each subsystem in each project folder?

    You can definitely organize your applications into as many packages as makes sense for your overall design.
    You can create and deploye packages of BC4J components in simple *.jar archives and then uses features of JDeveloper to import those shared packaged of components in a read-only mode in projects that need to make use of them.

Maybe you are looking for

  • Recording video on 24 fps?

    I wish to record video in 24 fps - dearly Is there any way to by pass the phones inbuilt regulations (30 and 60 fps)? For example, I use an app (vintage 8mm video camera), which makes my phone record, or at least appear to record, in 15 fps, so maybe

  • Report Painter - Need assistance

    Hi, I have been assigned a project where I need to use the Report Painter to copy the report behind transaction code IP31 (maintenance plan costing) and modify the copy in the report painter (according to modification requests/technical specs.) How d

  • Apps cant download or update

    i cant download and update my apps. Can someone tell me why and how to fix it? Thank you.

  • HT4059 iBooks 2/ iBooks Author

    There is neither iBooks 2 nor iBooks Author in my App Store in my iPad2. There is a video in the apple website showing how students interact with their iBooks/notebooks on iPads. I don't own a computer because I don't like computers. Is a computer re

  • Getting user name from sopa header

    How should get user name from soap header in my udf...?i searched in sdn,but not get exact solution...