Design Pattern / Best Practice Question

Hi,
I have been using Flex for a while now, but there is a
scenario which I still have not found a solution I'm entirely happy
with. I'm wondering if anyone else out there might have suggestions
on a design pattern or best practice.
Suppose I have a view which depends on model data which
resides in some back end systems. That model data may or may not
have been loaded (e.g. via a web service or remote object call) at
the time the view is displayed.
I don't know if the user will ever visit this part of the
application so I would prefer to defer retrieval of the data until
the user actually navigates to this view. Or I want to retrieve the
data each time the view is displayed because the data is dynamic
and could change between one presentation of the view and the next.
Because the data comes from several systems, I cannot simply
make one service call and display the view when it completes and
all the data is available. I need to call several services which
could complete in any order but I only want to display my view
after I know all of them have completed and all of the model data
is available. Otherwise, I can present the user an incomplete view
(e.g. some combo boxes are empty until the corresponding service
call to get the data completes).
The solution I like best so far is to dispatch a single event
(I am using Cairngorm) handled by a single command which acts as
the caller and responder for all of the services. This command then
remembers which responses it has received and dispatches another
event to navigate to the view once all the results have returned.
If the services being called are used in different
combinations on different screens, this results in proliferation of
events and commands. An event and command for each service and
additional events and commands to bundle the services and the
handling of their responses in the right combinations for each of
the views.
Another approach is to have some helper class listen for all
of the model changes and only display the view when the model
enters some state that is acceptable. It is sometimes difficult to
determine just by looking at the model whether it is in the right
state (e.g. how can I tell that a collection is the new collection
that should just have been requested versus an old one lingering
from a previous call). The logic required can get kind of
convoluted and brittle.
Basically, all of the solutions I've come up with so far seem
less than ideal and a little hackish. I keep thinking there is some
elegant solution out there that I am just missing ... but so far,
no luck finding it. Thoughts?
Thanks.
Bill

i think a service class is right - to coordinate your calls.
i would have 1 event per call (so you could listen to individual
responses if you wanted to).
then i would use a flag. if you want to check for staleness,
you would probably want two objects to map your service flag to
lastRequested and lastCompleted. when you check, check if it's
completed, and if it's not stale and that your lastRequested is
less than lastCompleted (meaning that you're not currently waiting,
i.e. you've returned since making a request). then make the request
and update your lastRequested.
here's a snippet of what i mean.
./paul
public static const SVC1_LOADED:int = 1;
public static const SVC2_LOADED:int = 2;
public static const SVC3_LOADED:int = 4;
public static const SVCALL_LOADED:int = 7;
private var completedFlag:int = 0;
then each call would have it's own callback.
private function onSvc1Complete( evt:Event):void {
completedFlag |= SVC1_LOADED;
lastCompleted[ SVC1_LOADED ] = getTimer();
dispatchEvent( new Event("svc1complete") );
checkDone();
private function checkDone():void{
if( completedFlag == SVCALL_LOADED )
dispatchEvent(new Event( "allLoaded" ));

Similar Messages

  • Design Patterns/Best Practices etc...

    fellow WLI gurus,
    I am looking for design patterns/best practices especially in EAI / WLI.
    Books ? Links ?
    With patterns/best practices I mean f.i.
    * When to use asynchronous/synchronous application view calls
    * where to do validation (if your connecting 2 EIS, both EIS, only in WLI,
    * what if an EIS is unavailable? How to handle this in your workflow?
    * performance issues
    Anyone want to share his/her thoughts on this ?
    Kris

              Hi.
              I recently bought WROX Press book Professional J2EE EAI, which discusses Enterprise
              Integration. Maybe not on a Design Pattern-level (if there is one), but it gave
              me a good overview and helped me make some desig decisions. I´m not sure if its
              technical enough for those used to such decisions, but it proved useful to me.
              http://www.wrox.com/ACON11.asp?WROXEMPTOKEN=87620ZUwNF3Eaw3YLdhXRpuVzK&ISBN=186100544X
              HTH
              Oskar
              

  • Process modelling : Design patterns & Best Practices

    Hi
    Could some one please suggest/share any technical information or documents tha's related to 'Process modelling - Design Patterns & Best Practices'
    Thanks in Advance
    Santosh K.
    Edited by: Santosh539 on Jul 29, 2010 4:07 PM

    Hi Santosh,
    There is no specific site with all the information you asked for.
    But I think these links would be helpful...
    on Work Flow Patterns: http://www.workflowpatterns.com/
    on BPM Service Pattern: http://enterprisearchitecture.nih.gov/ArchLib/AT/TA/WorkflowServicePattern.htm
    HTH
    Sharma

  • Best practice question -- copy container, assemble it, build execution plan

    So, this is a design / best practice question:
    I usually copy containers as instructed by docs
    I then set the source system parameters
    I then generate needed parameters / assemble the copied container for ALL subject areas present in the container
    I then build an execution plan JUST FOR THE 4 SUBJECT AREAS and build the execution plan and set whatever is needed before running it.
    QUESTION - When i copy the container, should i delete all not needed subject areas out of it or is it best to do this when building the execution plan? I am basically trying to simplify the container for my own sake and have the container just have few subject areas rather than wait till i build the execution plan and then focus on few subject areas.
    Your thoughts / clarifications are appreciated.
    Regards,

    Hi,
    I would suggest that you leave the subject areas and then just don't include them in the execution plan. Otherwise you have the possibility of running into the situation where you need to include another subject area in the future and you will have to go through the hassle of recreating it in your SSC.
    Regards,
    Matt

  • Best Practices Question: How to send error message to SSHR web page.

    Best Practices Question: How to send error message to SSHR web page from custom PL\SQL procedure called by SSHR workflow.
    For the Manager Self-Service application we’ve copied various workflows which were modified to meet business needs. Part of this exercise was creating custom PL\SQL Package Procedures that would gather details on the WF using them on custom notification sent by the WF.
    What I’m looking for is if/when the PL\SQL procedure errors, how does one send an failure message back and display it on the SS Page?
    Writing information into a log or table at the database level works for trouble-shooting, but we’re looking for something that will provide the end-user with an intelligent message that the workflow has failed.
    Thanks ahead of time for your responses.
    Rich

    We have implemented the same kind of requirement long back.
    We have defined our PL/SQL procedures with two OUT parameters
    1) Result Type (S:Success, E:Error)
    2) Result Message
    In the PL/SQL procedure we always use below construct when we want to raise any message
    hr_utility.set_message(APPL_NO, 'FND_MESSAGE_NAME');
    hr_utility.raise_error;
    In Exception block we write below( in successful case we just set the p_result_flag := 'S';)
    EXCEPTION
    WHEN APP_EXCEPTION.APPLICATION_EXCEPTION THEN
    p_result_flag := 'E';
    p_result_message := hr_utility.get_message;
    WHEN OTHERS THEN
    p_result_flag := 'E';
    p_result_message := hr_utility.get_message;
    fnd_message.set_name('PER','FFU10_GENERAL_ORACLE_ERROR');
    fnd_message.set_token('2',substr(sqlerrm,1,200));
    fnd_msg_pub.add;
    p_result_message := fnd_msg_pub.get_detail;
    After executing the PL/SQL in java
    We have written some thing similar to
    orclStmt.execute();
    OAExceptionUtils.checkErrors (txn);
    String resultFlag = orclStmt.getString(provide the resultflag bind no);
    if ("E".equalsIgnoreCase(resultFlag)){
    String resultMessage = orclStmt.getString(provide the resultMessage bind no);
    orclStmt.close();
    throw new OAException(resultMessage, OAException.ERROR);
    It safely shows the message to the user with all the data in the page.
    We have been using this construct for a long time for all our projects. They are all working as expected.
    Regards,
    Peddi.

  • SAP Adapter Best Practice Question for Deployment to Clustered Environment

    I have a best practices question on the iway Adapters around deployment into a clustered environment.
    According to the documentation, you are supposed to run the installer on both nodes in the cluster but configure on just the first node. See below:
    Install Oracle Application Adapters 11g Release 1 (11.1.1.3.0) on both machines.
    Configure a J2CA configuration as a database repository on the first machine.
    Perform the required changes to the ra.xml and weblogic-ra.xml files before deployment.
    This makes sense to me because once you deploy the adapter rar in the next step it the appropriate rar will get staged and deployed on both nodes in the cluster.
    What is the best practice for the 3rdParty adapter directory on the second node? The installer lays it down with the adapter rar and all. Since we only configure the adapter on node 1, the directory on node 2 will remain with the default installation files/values not the configured ones. Is it best practice to copy node 1's 3rdParty directory to node 2 once configured? If we leave node 2 with the default files/values, I suspect this will lead to confusion to someone later on who is troubleshooting because it will appear it was never configured correctly.
    What do folks typically do in this situation? Obviously everything works to leave it as is, but it seems strange to have the two nodes differ.

    What is the version of operating system. If you are any OS version lower than Windows 2012 then you need to add one more voter for quorum.
    Balmukund Lakhani
    Please mark solved if I've answered your question, vote for it as helpful to help other users find a solution quicker
    This posting is provided "AS IS" with no warranties, and confers no rights.
    My Blog |
    Team Blog | @Twitter
    | Facebook
    Author: SQL Server 2012 AlwaysOn -
    Paperback, Kindle

  • SAP Adapter Best Practice Question for Migration of Channels

    I have a best practice question on the SAP adapter when migrating an OSB project from one environment (DEV) to another (QA).
    If my project includes an adapter channel that (e.g., Inbound SAP Proxy listening on a channel), how do I migrate that project to another environment if the channel in the target environment is different.
    I tried using the search and replace mechanism in the sbconsole, but it doesn't find the channel name in the jca and wsdl files.
    What is the recommended way to migrate from one environment to the other when the channel name changes?

    I have a best practice question on the SAP adapter when migrating an OSB project from one environment (DEV) to another (QA).
    If my project includes an adapter channel that (e.g., Inbound SAP Proxy listening on a channel), how do I migrate that project to another environment if the channel in the target environment is different.
    I tried using the search and replace mechanism in the sbconsole, but it doesn't find the channel name in the jca and wsdl files.
    What is the recommended way to migrate from one environment to the other when the channel name changes?

  • Webi: BW Query design best practice question

    The scenario is as follows:
    SAP NetWeaver BW 7.01 SPS3
    Business Objects Enterprise XI 3.1 Fix Pack 1.2
    SAP Integration Kit XI 3.1
    Webi report built off of a BW Query. Based on the versions listed above, the MDX statement generated should only pick up only the fields listed in the query panel in Webi, not necessarily every field in the underlying BW query.  Having said that, does it matter what fields are in the Free CHAR or in the rows in the underlying BW Query??  I heard a suggestion that all fields should be put in the Free CHAR panel of the BW Query Designer but I don't see the value add of that approach.  Any thoughts?
    -Brad

    Hi,
    it does not matter if the items are Free Characteristics or rows or columns.
    for best practices here some material:
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/008d15dc-f76c-2b10-968a-fafe5a121129
    https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/b0320722-741c-2c10-afab-93b5c0fc7e96
    Ingo

  • Best practice question for Bounded task flows

    We are new to Jdeveloper/ADF and I was wondering if we should always try to use a bounded task flow for our applications... is this considered the best way to develop an app? even the small single page ones?
    Thanks in advance.

    Hi,
    let me turn teh question around: How many tools do you have at home beside of a hammer ? In other words, its the problem you need to solve (and use cases are problems) that should determine the use of bounded task flows and its granularity. Note that for each use case the bounded task flow makes a good candidate for delivering it. Doesn't mean that every single page needs to go into its own task flow. For general bounded best practices have a look here
    http://www.oracle.com/technetwork/developer-tools/jdev/adf-task-flow-design-132904.pdf
    Frank

  • HyperV 2012 best practice question (storage of guests)

    I was reading this post:
    http://blogs.technet.com/b/askpfeplat/archive/2013/03/10/windows-server-2012-hyper-v-best-practices-in-easy-checklist-form.aspx
    and I saw two things, one where it says fiber channel is not support and one where is says loopback is not support?
    so my question is for a best practice, would local storage (say a local attached raid 10) be considered best practice? or a shared
    san lun? and if a san, would virtual stuff like IBMs SVC be supported?

    Using a SoFS with SMB3 as a Storage for Hyper-V and SQL Server/Clusters is Microsoft Nr.1 and you will see more and more push for that Design in every next Version.
    The TOP Features for me in that Combo is, you get 100% of all Features on Day One when new Version comes out, within Microsoft SMB 3.x are some realy sexy Things in it and you can use all the Standard Ethernet Stuff yu have and know already for years. If
    you Need super Speed you can do that with some RDMA Cards, still Ethernet :-) and if you do a Live Migration between any Combo of Clusters and Single Nodes you never Need to move the Data and Config Files :-) they always stay on
    \\SoFS\VMs :-)
    All Information you need are on http://smb3.info , Jose, my Mr. SoFS  collects and blogs about all Features and Step-by-Step Guides to test and prove that even on one sinlge Notebook, very very cool.
    As a Backend fot the SoFs you have many choices, from the new Wave of JBODs togehter with Storage Spaces up to the old Style SAN Boxes with or without Special Features. Allways check the Windows Server Catalog for supported Confgs, specially on the JBOD
    Side, make sure you get one with R2 Support und also with SES Support (SCSI Enclosure Services ). Jose also Blogs about that Topics very well.
    https://blogs.technet.com/b/storageserver/archive/2013/10/19/storage-spaces-jbods-and-failover-clustering-a-recipe-for-cost-effective-highly-available-storage.aspx
    http://www.windowsservercatalog.com/results.aspx?&chtext=&cstext=&csttext=&chbtext=&bCatID=1642&cpID=0&avc=10&ava=0&avq=0&OR=1&PGS=25&ready=0
    Hyper-V Cluster up to 64 Nodes and SoFS up to 8 Nodes depending on your Scaling Needs and having Storage splitted over separat DataCenters should be a good start :-)
    Just let me know of you need some Advice after doing a Design Session.
    Udo

  • Best Practices: Question about Passing DataSet to Crystal through C#

    I have used the tutorial provided by Business Objects and have successfully passed a dataset from C# code to Crystal Reports.
    I have a few questions about "best pratices" though.
    It appears that when passing the dataset to crystal then you no longer have the ability to put SQL Expressions in the report anymore otherwise errors will occur.
    So, I'm trying to come up with a way to have a custom field in the SELECT statement and have it show up on the report as a field. So, in the below example I created a custom SQL field called TIMES7 in the query.
    "Select CLM_ID, CLM, PAID_111X, *(PAID111X * 7) As TIMES7*_ From WIKI.MULCRICKET WHERE CLM_ID < 5"
    If I create a formula field in Crystal and set it's value to {MULCRICKET .TIMES7} then it works like a hybrid SQL Expression at run-time.
    This does work but has issues because the database field doesn't really exist in the design environment which causes error when the formula is saved. But it does work at run-time.
    I was wondering if their was a best practice for this?

    So why are you using a formula that doesn't work? If it errors in the designer it's telling you it's not supported.
    Drop the formula into a filed and hide it if you don't want it displayed, this way it gets into the record selection formula.
    "Best Practices" is don't use formulae that won't verify in the Designer. "If it doesn't work in the designer it won't work in code"
    If you need to add an "unknown" field at run time then use RAS to insert the field.

  • Translation patterns - best practice

    We have 300 DIDs from our telco.    Currently, only 150 are in use.   If a call comes thru for a non-asigned number, I would like to set-up a call handler that states the number is a non-working number that belongs to the company and then give options for contacting the correct person.      Also, when a person leaves the company I am currenly forawarding the number to the operator but I would also like to make these numbers part of the call handler.
    My question is this - what is the best way to set this up?    I currently am removing the number from the directory numbers and setting up a translation pattern to point the number to an end point such as the operator.    Is this the best thing to do?    I would like to know what is considered to be "best practice" in keeping the phone system as clean as possible.
    I appreciate any input.
    Pat

    I would setup a catch-all scenario with a translation to a CTIRP that would forward to VM and hit the Call handler you desire.  For example if you had the DIDs 212-555-1000 thru 212-555-1299 i would first setup a non-DID CTI RP that matches your call handler dtmf (e.g. 7999 if you use 4 digit extensions).  the CTI RP for 7999 would forward to VM and then the Call Handler with DTMF of 7999 would play your message that number is not in use.
    Then setup a translation for 212-555-1[012]xx that translates to 7999.
    This wildcard match would not route the call if there was a more specific match present within the Calling Search Space for the Gateway.  So if extension 1050 was present it would route to that phone, but if extension 1051 was a terminated or unused number it would not be present and therefore the call would hit the translation and be routed to the "number not in use" call handler.
    I think this is what you are after, a way to minimize the translations and not have to keep track of individual numbers.  Of course modify the length of the translations if you are not routing based on 10 digits.

  • Network Design Review - Best Practices

    Looking to start a discussion around best practices for inbound network design at the core. 
    The planned devices are as followings:
    Edge Routing / DMVPN - Cisco 2951
    Cisco UCM / IP Phone VPN Concentrator - Cisco ASA 5512-X
    Cisco AnyConnect SSL Client Concentrator - Cisco ASA 5515-X
    Cisco FirePower / IPS Device - Cisco ASA 5515-X
    The plan is as follows:
    All traffic enters through the 2951. 
    DMVPN traffic will go directly to the FirePower Device and then to the core network.
    IP Phones will pass-through 2951, enter 5512-X for VPN, go to FirePower and then to the core network.
    AnyConnect Clients will pass-through 2951, enter 5515-X for VPN, go to FirePower and then to the core network. 
    Wondering if anyone else has completed a similar setup and any issues you may have fun into. 
    Basic diagram attached. 
    Thanks!

    There really isn't a true two factor authentication you can just do with radius unless its ISE and your doing EAP Chaining.  One way that is a workaround and works with ACS or ISE is to use "Was machine authenticated".  This again only works for Domain Computers.  How Microsoft works:) is you have a setting for user or computer... this does not mean user AND computer.  So when a windows machine boots up, it will sen its system name first and then the user credentials.  System name or machine authentication only happens once and that is during the boot up.  User happens every time there is a full authentication that has to happen.
    Check out these threads and it explains it pretty well.
    https://supportforums.cisco.com/message/3525085#3525085
    https://supportforums.cisco.com/thread/2166573
    Thanks,
    Scott
    Help out other by using the rating system and marking answered questions as "Answered"

  • Best Practice question - null or empty object?

    Given a collection of objects where each object in the collection is an aggregation, is it better to leave references in the object as null or to instantiate an empty object? Now I'll clarify this a bit more.....
    I have an object, MyCollection, that extends Collection and implements Serializable(work requirement). MyCollection is sent as a return from an EJB search method. The search method looks up data in a database and creates MyItem objects for each row in the database. If there are 10 rows, MyCollection would contain 10 MyItem objects (references, of course).
    MyItem has three attributes:
    public class MyItem implements Serializable {
        String name;
        String description;
        MyItemDetail detail;
    }When creating MyItem, let's say that this item didn't have any details so there is no reason to create MyitemDetail. Is it better to leave detail as a null reference or should a MyItemdetail object be created? I know this sounds like a specific app requirement, but I'm looking for a best practice - what most people do in this case. There are reasons for both approaches. Obviously, a bunch of empty objects going over RMI is a strain on resources whereas a bunch of null references is not. But on the receiving end, you have to account for the MyItemDetail reference to be null or not - is this a hassle or not?
    I looked for this at [url http://www.javapractices.com]Java Practices but found nothing.

    I know this sounds like a specific apprequirement,
    , but I'm looking for a best practice - what most
    people do in this case. It depends but in general I use null.Stupid.Thanks for that insightful comment.
    >
    I do a lot of database work though. And for that
    null means something specific.Sure, return null if you have a context where null
    means something. Like for example that you got no
    result at all. But as I said before its's best to
    keep the nulls at the perimeter of your design. Don't
    let nulls slip through.As I said, I do a lot of database work. And it does mean something specific. Thus (in conclusion) that means that, in "general", I use null most of the time.
    Exactly what part of that didn't you follow?
    And exactly what sort of value do you use for a Date when it is undefined? What non-null value do you use such that your users do not have to write exactly the same code that they would to check for null anyways?

  • Best Practice Question

    I have 3 Areas for my DWH
    The first area is Staging then validation and core
    Staging is just do load date from the source systems
    validation is to validate data (every city has to have a countrie ....)
    core is my DWH shema.
    The First step in ETL is to load the data from core to validation, let's say my GEO_DIM Dimension goes to Countries, Cities and Regions in core. Additionaly I build a CRC SUM when I downlaod from Core to Validation and store the CRC Checksum in a Staging table.
    The second step is to load target from the source systems to staging, but only those date that are non equal to the previous downloadet CRC schecksum, so only changed or new data going to staging.
    The third step is do load that new/changed data from staging to core and proof some dependences. It's just validation.
    My Question is, what is the best practic to bring three tables (Countries, cities and region) to one Dimension
    thanks and regards
    Andreas

    Andreas,
    I guess the correct is depends... Without kidding, are you planning to use a flat star table for this dimension? If that is the case you would be joining the sources together and loading this into the table.
    Now this sounds way to simple, so I guess there is something more to the question...
    Jean-Pierre

Maybe you are looking for