Is this a good design pattern?

Hi,
I am working with a team to create an application that can acquire data from up to 24 thermcouple channels.  We plan to create a wizard to assist the user in setting up the test (specifiying stop conditions, sample rate, channels to sample, output file, and email/text notifications).  After the setup, if the user does not cancel out, then the program continues.  We have defined parallel loops and their roles, trying to fit into a producer/consumer design pattern.  I have attached the main file which shows the structure of the program.  We are trying to keep it clean and modular.  Before diving into development, we are finalizing a detailed design specification so that different people can work on each of the loops' subvis.  I was hoping that people could review the block diagram and offer suggestions for improvement or validate that we have chosen a good method of implementation.
Notes about the block diagram
The plan is for data driven stop conditions to be detected by Event Notifier, handled by the Main UI event, and then the Data Collector is instructed to stop (as well as the Main UI loop).  When Data Collector stops, it releases queues, the queue reference becomes invalid, and then the loops with the Dequeue will be stopped.
I am not sure if an additonal event structure should be in the DataCollector to specifically handle the Stop button on the UI because if it is in the Main UI event structure, the DataCollector would not be stopped immediately.  This is important to stop quickly because the sample rate could be VERY long.  I understand about using an event structure instead of WAIT, but didn't know if there is an efficient way leaving it down in the Main UI event structure....????
Data Collector is the producer, it currently only collects data and passes it on.  If the program is going to contain a start collection button, or pause/resume, I need to figure out how to handle this with the Main UI event structure.
Event Notifier consumes data from the Data Collector.  It looks at all data and should set a flag if a stop condition is met.  The flag will be handled by the Main UI event structure to tell Data Collector to stop.  The event notifier also sends a notification to the Email/Text Caller when thresholds have been exceeded warranting a reason for the user to be notified via text or email.
Email/Text Caller waits for notification and then calls a subVI to send an email or text with certain data and channel information.  The subVI call is lengthy, so we decided to put this in its own loop instead of a case structure inside the Event Notifier.
Report Generator logs all collected data to a file.  A second queue was used, but uses the same data as the first.  Is this the correct implementation since two consumers need the same data?
Main UI - handles changing of sample rate, possibly the stop button, possibly start/pause/resume of data collection.  Also handles when Event Notifier sets flag for a data driven stop condition, which then should provide a mechanism to stop the Data Collector.
A big question that i have is.... Should the Main UI event structure just be in the Data Collector so that the loop can be stopped immediately?  All of the UI events (stop button, start/pause/resume data collection) directly effect the Data Collector.  Should the data Collector have a state machine instead?
I feel that the 3 consumer loops (Event notifier, Email/Text Caller, and Report Generator) seem like a good implementation, but i am not confident about the Data Collector and Main UI loops.  Should they be combined?
Solved!
Go to Solution.
Attachments:
updatedMain.vi ‏13 KB

A couple of thoughts:
Overall it looks workable- remember to name your queus and notifiers- then you can depop the BD and launch each loop in its own sub-vi without wiring all those queues between loops- Just obtain ref to named queue.
"Data collector" needs a supervisor to control how often the data is collected- I'm thinking a QSM with "init- collect- stop" states.  A simple timed loop could produce the "time to acq ticks" under control of the sample rate control. This puts both the DAQ init and cleanup functions within the Data Collector's perview so it aids coehesion and solves the exit without waiting for the loop to iterate.
I'm not a fan of duplicating data- I assume analisys is pretty much just some comparisons- so it is pretty quick- Why not append summary data to the same queue? And make it a single element queue- the report loop can then inspect the queue and look for a summary data "index" - if its greater than the last index written append the darn data to the report?  Preview queue works great for these situations.
Do not combine the UI handeler with anything else! Do you see the snag?- hint: here thar be spaghetti.  keep the functions seperated for solid scalable and maintainable code.
One last thought:  Its getting less popular to stop loops on the error out of a dequeue.  First it returns a default element that can cause your listeners some headaches.  Second it doesn't let you run cleanup code.  Use a stop command <enum> built into the element data as an executive to determine when to stop.  We'll try to get the examples updated to show current best practices.
Jeff

Similar Messages

  • Is this a good design -- XI and another EAI tool in the same landscape

    Hi All,
    I am working in a project wherein the client already has an EAI tool which is based on SOA(Web Services). They are implementing SAP systems in their landscape. They now want to use SAP XI in the landscape for the purpose of integration. They want to integrate their initial EAI tool with XI and have the existing integration with NonSAP systems as it is and integrate SAP systems using XI.
    Is this a good design having two EAI tools being used for integration between two systems? What are the various issues that need to be taken into account?
    Answers will be promptly rewarded.
    Thanks and Regards,
    RM

    R M,
    There are lot of points that has to be considered when evaluating the design of EAI landscape. I heard somewhere that even SAP does not recommend to scrap the existing landscape and bring in SAP XI there. I gues dual hub gateway is very common unless it is a fresh implementation becuase changing the existing landscape is re-investing the cost again for the customers.
    If you ask me then SAP XI is not yet so robust to handle huge volumes in real time data integration and SAP XI can be used in between for integration to SAP system as it is a SAP system and it works excellent integrating with SAP systems.
    Check out this thread which is a transcript of a 10 year EAI architect :
    in my company we had more or less the same situation 2 years back, a existing BizTalk solution, and whether we should introduce XI or not.
    We concluded with the following; BizTalk should be used as the main integration engine between the different system landscapes and ALL external communication, and XI should be used as the integration engine for all data to/from our SAP system landscape. Depending on the integration scenario, we may use both.
    BizTalk will not see any SAP systems, only web services exposed by XI or using IBM MQ depending on an async/sync integration scenario.
    We believe that XI is better with integration from/to SAP, and;
    - In future SAP will deliver out of box integration for the XI system (XI content) for Enterprise Services Architecture
    - Several components in the NetWeaver stack are using XI for communication
    We have a SAP system landscape with several 46C systems (IS/OIL, HR ...) and newer NetWeaver solutions.
    I can give you a brief resume of our experiences – my background is ABAP developer since ’98, I have implemented a few BizTalk solutions to SAP 46C, and I’m a certified XI developer and developed several XI solutions between SAP 46C/640 and BizTalk.
    BizTalk ******
    Overall communication between SAP systems and BizTalk depending on the integration scenario and who is the initiator:
    SAP 46C to BizTalk:
    There are no good mechanisms available for sending data from 46C to BizTalk, we are using HTTP_POST with XML payload. Then you must use the iXML library on the SAP side, its ok, but you will spend, in my point of view, too many hours on XML programming that can be generated automatically.
    BizTalk to SAP 46C - Which SAP adapter to use for BizTalk?
    We started with SAP adapter from IWay, but that adapter gave us a lot of problems on the BizTalk server (pretty complex adapter with strange behaviour, and several integration scenarios stopped working for no reason at all (unstable)).
    Due to several severe problems, we switched to SAP adapter from Microsoft 1 year back in time. If I don’t remember wrong, back then, the SAP adapter from Microsoft did not support parameter of type string or table types – so there are/were some limitations regarding the signature of the RFC function.
    The SAP adapter from Microsoft is more stable than the previous, BUT we have some hick ups with that one as well when BizTalk does very frequent calls to SAP 46C.
    SAP 640 to/from BizTalk:
    I assume you can use the web service functionality on the SAP side in order to send/receive data, but I don’t know whether 640 support asynchronous web service.
    XI *****
    The communication mechanism between different SAP systems and XI are much better than with BizTalk:
    SAP 46C to XI:
    Configure a sender communication channel with RFC adapter; basically the XI system will be RFC server so the only thing you have to do is to create a RFC port on the 46C system “pointing” to the XI system. In the Abap program, you can do normal function calls with destination (RFC port) AND the RFC call will automatically be translated to XML on the XI side.
    Thus, you can forget all about the iXML library and XML rendering of the payload to HTTP.
    Besides, you can choose to use sRFC, tRFC or even qRFC depending on the integration scenario and whether you want guaranteed delivery.
    XI to SAP 46C:
    More or less same as BizTalk using a SAP adapter, but string and table types are supported.
    SAP 640 to/from XI:
    This is a very nice situation, every 640 has a local integration engine, so the main integration engine (XI) can send/receive XML messages both async/sync. Another advantage is using the SPROXY transaction on the 640 system, generating automatically a proxy class being able to send/receive messages based on a message interface defined in XI (outside-in programming).
    Finally *****
    BizTalk and XI are at a conceptual level identical, two integration engines with the purpose of send/receive, route and do message transformation (mapping) using adapters to different technical systems.
    Microsoft has a lot of resources available and for sure, BizTalk will be a very good choice for most companies.
    SAP came late with XI, but they are not trying to make the best integration engine, but good enough. And for sure, I think SAP will come with very nice XI content in time (interface mappings between message interfaces – business solutions) which is beyond BizTalk.
    As an ABAP programmer I just love the transport system between development, quality and production systems. We are using the CMS transport systems between our development XI, quality XI and production XI – it is so nice and fast. With BizTalk you have to create a MSI file (installation file – which files to include…) and somehow transport the file (mail or whatever) to the quality environment for installation – really tedious work compared to XI.
    So we are using BizTalk 2004 and XI 3.0 and are very happy with both.
    Note:

  • Is this a good design?

    I am designing an online application. There is a super class DataItem and 3 subclasses. Also, each of the classes has a dao class with the same inheritance relationship. In each sub DAO class (extends DataItemDAO), it has its own getContentItems() method which calls getItems() method in DataItemDAO class.
    The getItems() method in DataItemDAO takes DataItem as one of its parameters. So it could get all the setter methods of the object and invoke them using Java API and store the objects in a Vector and return the Vector. Basically, my idea is to have get, create, update, and delete actions all handled in the superclass level. Since each subclass has its own attributes besides the ones in the superclass, I guess I have to use Java API to get the setter methods in order to set attributes of each subclass object.
    Do you think this is a good approach? Are there any cons using Java API to invoke methods? Any suggestions/alternatives? Thanks.

    I guess when you write java api you really mean Java Reflection!?
    If so here are my thoughts (well I guess they are there even if you refere to something completely different)
    a) Reflection is slow and hard to debug since you have to do a lot of the stuff at runtime which normally the compiler gives you at compile time.
    b) It sounds quite flexible
    So the question is: what is more important: speed (development and execution wise) or flexibility.
    You might also consider an aproach which generates your dao classes. It's flexible and fast (once you created the classes and their instances)
    One serious drawback in simple using the getters and setters is that you can't simply add accessible fields which aren't persistent.
    Regards
    Spieler

  • If  a dto extends from a super class   is this a good design ?

    I am confused whether to extend my dto from another dto ,I wanted to seperate the common properties like the pagination and sort form all my search dto's, if I do this all my search dto's will extend from common dto ,but because dto is just a pojo is it good to create inheritance in DTO's ?

    Since a DTO should just contain fields and minimal logic you should have less problem with inheritance for DTO than other classes.
    Is there a specific doubt you have in this regard?
    I suggest you take the approach which seems simplest to you.

  • New to servlets - Is this a good design?

    I would like to create a web app whereby a user pastes large amounts of text (thousands of words) into a text field, then to have the text transformed and sent back and displayed to the user. To transform the text, a memory intensive model is required (currently it ranges between 500-1000mb). Therefore with my understanding I will have an html form send the text via post to an httpservlet. The servlet itself will read the data pertaining to the model (via database or file) and construct the model once during the servlet initialization stage. Then the servlet will transform the text and send it as a response to display it on a new html page for every request while the servlet is alive.
    My main concern is the life cycle of a servlet. If the servlet is not handling requests because there are no requests to handle, from my understanding the servlet will terminate. Then later on when a request does come through, a new instance of the servlet will be created. Therefore I am worried that the model to transform the text will need to be reconstructed. I'm worried because this involves large amounts of data and can take thousands of milliseconds to construct.
    My desired solution is to have the model that transforms the text constructed once, somewhere on the server for the servlet to query, preferably inside the servlet itself.
    Hopefully someone can clarify this for me and comment on my broad approach.
    Thanks

    user11105060 wrote:
    I will restate my problem since it's not exactly clear in the previous message.
    I want an HttpServlet to process text sent to it from an html form and then display this on a subsequent form. The issue confronting me is that I have to create a memory intensive object (model) that is fairly time consuming to create, before I can process the text. The fortunate thing is that the object (model) is always the same and never changes, therefore I only ever need to construct it once to process any text.
    I would like to know if it is possible to construct this model once and only once for the HttpServet that will use it to process the text, or do I have no control over this? That is, if the httpservlet is created then destroyed then recreated, will I have to reconstruct the model again? Is it possible to keep this model in memory and pass it to the httpservlet constructor as a parameter?
    If the question is not clear, could someone please say so.
    Thank you.So you need your model object to basically only exist once in the entire application, right?
    Seems like you found a reason to use a singleton.

  • Good design choice, different types of customers, from webservice

    Hi, I have thoughts about good design pattern, when doing this:
    You have a webservice where customers coming into your system. The customers are private ones, business ones, and big business types.
    These 3 customer types has different needs, and must have different values like companyname, social security number, etc etc.
    The customer also has some shared types, like customerid, created, updated, etc.
    So what you want to do is to have an interface or an abstract class containing common methods for the customer, then you will create subclasses for the different types.
    I was thinking about creating a factory class and pass in the customer object retreived from the webservice, and in the factory process method create objects on the different subclasses based on what kind of object you get in (private, business, etc).
    So, webservice gets a private customer object, you serialize it and then you pass it into your factory class. And back you get a customer object.
    Now you want to do business logic on the object, storing it to a database, etc.
    So you might still have to create different scenarios based on if its customer type.
    The basic idea is that you want to get the object from webservice, pass it to a factory and get back a customer object which you want to do things with.
    What do you think, what is a good design solution to the problem described?

    To be clear "pattern" has a specific meaning. Your description is a design not a pattern.
    Is the small business one never going to become a big business one?
    Is a big business one never going to become a small business one?
    If the answer to either is yes, then you have one entity with different attributes, not two.
    I have no idea why serialization would matter in this. And your description doesn't explain that either. If you are talking about communication between different boxes then you need a communication layer (and it doesn't appear you are at the level yet where you need to decide the specifics of how that is handled.)
    It is unclear why you would want a factory. But if you just want the experience then you could probably use it.
    Your description isn't nearly complete enough to define how the overall system should behave which is what you seem to be also describing. You need to seperate what the system will do for how it will do it (the design.)

  • Can you suggest a Design pattern for moving a desktop app to  web?

    Hi,
    I have been asked to move a desktop applciaiton which has Serialized files as persistant layer in to Web, can anyone suggest me a good design pattern to accomplish this.

    I dont know what data is in the files, but I suggest looking at creating a set of database tables, normalize them, and copying the data to the tables (via java). Have a DBA review your database schema design if possible before copying the data. Then, use MVC design as I describe here:
    http://forums.sun.com/thread.jspa?messageID=10786901
    Once you get experience in the MVC design described above, your next project can use MVC with a framework such as Java Spring (a more advanced topic). You should read a book cover on Spring to cover on it first.

  • Design Pattern for execution queue

    Anyone know of any good design patterns for using a JMS Queue and MDB's
              as async
              execution queue which maintains execution order by some key
              

    Enforced ordering on redelivery will be supported in the
              next release, but only if the application clamps the pipe-line
              size down to its minimum and the MDB pool size down to one.
              I don't think enforced ordering is supported in the current release.
              We are looking at least partially addressing the general design
              pattern below in the release after next. I don't think I can
              get away with being more specific. (Sorry.) Currently, I
              think something along the line of Larry's solution is the only way to
              accomplish it. Interestingly, the recent thread started
              by "[email protected]" on correlating requests and responses
              seems to be somewhat related.
              Tom, BEA
              Larry Presswood wrote:
              > Well you are both correct however we have something which works
              > however it does involve some threading primitives which generally is not
              > a good idea
              > inside wlas but seems to work.
              >
              >
              > Generally have a singleton on the server which has slots for each key
              > with message
              > numbering for each message and force a wait if message for key is out of
              > order
              > during fifo processing rules. IE do what things you can do in parallel
              > but gate for
              > the last step.
              >
              > I think there is a general remote execution pattern out there.
              >
              > The general problem to solve is this:
              >
              > In a messaging system you want to process messages for each key/session
              > in order however
              > with a large number of sessions its possible to parallel messages for
              > different sessions
              >
              > Otherewise you can either create custom queues or a topic with a
              > selector and then
              > create custom consumers which does not behave as well from a resource
              > perspective
              > as MDB's do.
              >
              >
              >
              >
              >
              >
              >
              > Nick Minutello wrote:
              >
              >>I may be completely wrong - but I think that Larry is referring to the inherant
              >>out-of-order message consumption that you get when using MDB pools to consume
              >>from a Queue.
              >>
              >>In short, the only design pattern here is to deploy the MDB to only one machine
              >>in the cluster - and set the pool size to 1.
              >>
              >>In-order execution is incompatible with the parallel execution that MDB's give
              >>you.
              >>
              >>-Nick
              >>
              >>
              >>
              >>Tom Barnes <[email protected]> wrote:
              >>
              >>
              >>>Hi Larry,
              >>>
              >>>Generally, I think it is best to have a seperate queue per key if the
              >>>
              >>>number of keys is small. This prevents starvation of a particular
              >>>message. For example when handling message-priority, low priority gets
              >>>
              >>>an MDB pool of size 1, high priority gets and MDB pool of size 10.
              >>>
              >>>Note that WebLogic JMS allows a queue to specify a sort-order keys based
              >>>on arbitrary message fields. Note that the in-flight message pipe-line
              >>>
              >>>between server and asynchronous clients is unsorted.
              >>>
              >>>Tom, BEA
              >>>
              >>>Larry Presswood wrote:
              >>>
              >>>
              >>>>Anyone know of any good design patterns for using a JMS Queue and MDB's
              >>>>
              >>>>
              >>>>as async
              >>>>execution queue which maintains execution order by some key
              >>>>
              >>>>
              >>>>
              >>
              >>
              >>
              >
              

  • Design Pattern for Controlling Uniqueness

    Hi,
    I'm looking for a good design pattern for controlling uniqueness. E.g. I have classes representig a particular database relation. The constructor has the database key(s) as parameter(s). For the other attributes there are corresponding setter and getter methods.
    How can I make sure, that I have only one instance with key(s) foo in my system?
    Of course I have some ideas but I'm not sure if that is the best thing I could do. So I could use a map, to map the keys to the tuples.
    This map could be in another class foo2 which creates the objects of foo1 (which has only a protected or package-private constructor).
    Or I could place the map into foo1 itself as a static variable, and add a static factory method. The constructors would then be protected or private. Are these solutions good? Which one to prefer?
    How can I handle other unique attributes (not part of the key)?
    The equals method for such a class could then test the keys only, since there is only one object with such a key in the system, right?
    Thanks for any help.
    Greets
    Puce

    The class could have only private constructors and a public static getter method, which would decide based on some collection of the object created so far, whether to create a new one or give an old one.

  • Best design pattern for a large number of options?

    Hi,
    I'm faced with the following straightforward problem, but I'm having trouble coming up with a design solution. Any suggestions?
    Two items in the database can be related in three possible ways (temp replacement, permanent replacement, substitute). Each item has three possible stock levels. The user can select one of two items.
    This comes out to 54 different prompts that need to be provided to the user (example: "The entered item has a preferrable temp replacement available that is in stock, sell instead of the entered item?", "The entered item is out of stock, but has a substitute item available, use instead?", etc. etc.)
    Does anybody have a suggestion of a good design pattern to use? In the legacy system it was implemented with a simple case statement, but I'd like to use something more maintainable.
    If anybody has any suggestions, I'd appreciate it.
    thanks,

    In the legacy system it was
    implemented with a simple case statement, but I'd like
    to use something more maintainable.Is it ever likely to change? If no, then a case statement is pretty maintainable.
    How is the data retrieved? I'm guessing it's a decision tree: if the desired object is in stock, return it, otherwise look for a permanent substitute, &c. In this case, perhaps you have a retrieval object that implements a state machine internally: each call to the retrieval operation causes a transition to the next-best state if unable to fulfill the request.
    If you do retrieve all possible data in a single query (and I hope not, as that would almost certainly be very inefficient), then think of some sort of "preference function" that could be used to order the results, and store them in a TreeMap or TreeSet ordered by that function.

  • WebService Design pattern

    Hello everyone,
    I'm working with a WEbService using Axis1 generated client code.
    Can anybody give me a good linkg to a Design pattern to use such generated code.
    Regards,
    Sebastien Degardin

    I don,'t fully agree with that.fine. why bother asking questions if you're just
    going to disagree with the answers that don'tmatch
    up with your own?Because, i aksed a question, nobody give me an
    answer.
    They, you, just contested the question, not trying to
    respond.
    That's why I don't FULLY agree.there is no answer to your question. a design pattern won't tell you how to use generated code. a design pattern might help in using specific generated code, but that's not what you asked. we can't second-guess what your code looks like, and what you need to achieve with it
    >>
    Patterns and Pattern Languages are ways todescribe
    best practices, good designs, and captureexperience
    in a way that it is possible for others to reusethis
    experience.you specifically asked about design
    patterns.
    more specifically, webservice design patternsI said, i USE WebService with Axis, and asked for
    Design pattern for such case. not asked for desicion
    about design pattern.see above reply. design patterns are not magic beans that can be applied to any problem. especially, not to vague problems like this one
    A design pattern for Axis generated code is
    possible.you're telling me there is a "use axis code" pattern? there isn't, any more than there is a general-purpose recipe for chefs. if you think there is, lots of luck tracking it down.
    Of course, i found a way to use a generic mechanism
    to centralize the request creation, request call and
    response validation.
    This avoid boilerplate code in each method call.
    But, that said, i don't have so much experience with
    that, that's why i asked for another example ...
    So, in my case, i think there should be best orgood
    practices which have been captured by experiencewith
    WebService and Axisv or other auto-generated
    code
    which would provide reusabilityn, scalabilityand
    For me Design pattern are applicable for a lot a
    things in a lot of domains.good for you. but remember that "for me" is not
    necessarily the same as "in reality"If you take EJB 2.1 and DTO, they are not always seen
    as good practices.
    But, however, they are books which related Design
    Pattern for such technologies, and they don't talk
    about the desicion of choosing EJB or NOT.what are you talking about? the DTO pattern solves - sort-of - a specific problem that often arises while using EJB, for example. it's not a "how to use EJB" pattern

  • Database Design Pattern

    hi all,
    I am developing a J2SE application which is communicating with two DB schemas.
    Do any one suggest any good design pattern to manage these type of situation.
    I was thinking to create two DAO classess for two different DB schemas?
    I am using oracle 10g as database.
    Regards

    Keep in mind that Oracle is not a database. Oracleis a database management system (DBMS).
    RDBMS, no? Both acronyms apply; Oracle is a DBMS and a RDBMS.
    Then what is the official name for the
    database itself? There is no official name for "the" database, because Oracle is not a database. Oracle, SQL Server, etc. are software for managing relational databases. They provide users with the ability to create relational databases. They provide various transactional and security features related to relational databases. They host a query language interpreter so that users can search relational databases. They have internal systems databases for managing the databases that users create.

  • What is a good design for remote Views?

    Hi All,
    I am thinking how would I design my process for performance consideration in retrieving dynamic values of table/view data.
    The requirement is like this:
    1. We have 50 databases residing on each own server counterpart (50 servers).
    2. Each database has table Patch_LeveL (apps_name, patch_level), which contains  just one row only to reflect the latest patch level applied for the apps on this database. Note that are we constantly on applying service packs for this apps.
    3. On our central monitoring server (db). I create 50 database LINKS for each of the 50 databases.
    4. I created 50 views over these links to make  it centralized to represent  the 50 Patch_Level tables. As   patch_level_view1, 2, 3.....patch_level_view50.
    5. I then create a central view as .... as  union of the 50 individual views Actually I am just planning to do the above activity.
    My question is....is this a good design for performance? Can you share be a better approach?
    Is there a limitation of joining "union" of 50 views?
    Thanks a lot,

    Is there a limitation of joining "union" of 50 views?What can happen is if the connection to one of these servers is interrupted, the big "union" view will not work. As said by above poster MV, with lets say an hourly refresh, helps with this situation as you have the data that was gathered last time (and most likely it is still valid).

  • What is the best design pattern for this problem?

    No code to go with the question. I am trying to settle on the best design pattern for the problem before I code. I want to use an Object Oriented approach.
    I have included a basic UML diagram of what I was thinking so far. 
    Stated simply, I have three devices; Module, Wired Modem, and Wireless Modem.
    In the Device Under Test parent class, I have put the attributes that are variable from device to device, but common to all of them.
    In the child classes, I have put the attributes that are not variable to each copy of that device. The attributes are common across device types. I was planning to use controls in the class definition that have the data set to a default value, since it doesn't change for each serial number of that device. For example, a Module will always have a Device Type ID of 1. These values are used to query the database.
    An example query would be [DHR].[GetDeviceActiveVersions] '39288', 1, '4/26/2012 12:18:52 PM'
    The '1' is the device type ID, the 39288 is the serial number, and the return would be "A000" or "S002", for example.
    So, I would be pulling the Serial Number and Device Type ID from the Device Under Test parent and child, and passing them to the Database using a SQL string stored in the control of the Active Versions child class of Database.
    The overall idea is that the same data is used to send multiple queries to the database and receiving back various data that I then evaluate for pass of fail, and for date order.
    What I can't settle on is the approach. Should it be a Strategy pattern, A Chain of Command pattern, a Decorator pattern or something else. 
    Ideas?

    elrathia wrote:
    Hi Ben,
    I haven't much idea of how override works and when you would use it and why. I'm the newest of the new here. 
    Good. At least you will not be smaking with a OPPer dOOPer hammer if I make some gramatical mistake.
    You may want to look at this thread in the BreakPoint where i trie to help Cory get a handle on Dynamic Dispatching with an example of two classes that inherit from a common parent and invoke Over-ride VIs to do the same thing but with wildly varying results.
    The example uses a Class of "Numeric"  and a sibling class "Text" and the both implement an Add method.
    It is dirt simple and Cory did a decent job of explaining it.
    It just be the motivation you are looking for.
    have fun!
    Ben
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction

  • Is there a design pattern for this?

    I'm looking for a solution to a design problem I have.
    For a restaurant booking system I need a number of different opening times describing when you can and cannot book. These opening times are essentially Jodatime Period objects. There's a set of opening times spanning a week and these are repeated for every week (a default set of opening times) however it's possible to override these opening times say for a specific day.
    The domain model would be something like a Restaurant class holding 2 Lists of OpeningTime objects one for defaultOpeningTimes and the other for overiddenOpeningTimes the overidden ones get used if they exist for the requested time period. However the database model would be a bit messy as I'd have 2 lists mapping to the same table (OpeningTime). Is that a good idea? Perhaps there's a design pattern for this, if someone could point me in the right direction I'd be very grateful, or perhaps this is the best solution? Thanks!

    jduprez wrote:
    But why do you put the logic in the database too (I'm no DB expert and I didn't know these concepts until I read your post, but that's what a dynamic view based on derived values looks like to me): performance (1 round-trip instead of two)?Hi jduprez. Long time no speakee.
    I guess part of it is that I spent many years as a DBA and modeller, and really appreciate what it's taught me about design. Also, databases are (or should be) designed from the ground up to provide data-directed requests optimally, and include all sorts of nice stuff like transaction handling that aid consistency, as well as speed.
    That said: I HATE SQL. Think Coliseum, with that emblazoned in 60-foot high letters around its walls, and it might come close to just how much I hate that so-called "language". I hate its form; I hate it's inconsistencies; I hate the fact that something like what OP is trying to do is NOT an easy task (and might involve the creation of a table that simply contains Dates, just in order to satisfy Boolean logic).
    However, once you work it out, a database view (at least from the database's standpoint; JDBC I'm not so sure about) is just like any other Table - and that I DO like.
    Programs are good at processing parameterized (ugh) temporal information; databases are good at persistence and high volume. Those two may meet at some point, but I reckon it's going to take another Codd (or Joda) before it does.
    - that's clearer to 90% of the dev team (my biased numbers, based on 50% of Java developers having decent knowledge of SQL and much less than that having the advanced SQL knowledge which I rank your suggestion at)Sounds to me like you'll get the solution that matches the skills you have then. Is that what you really want, if a better one is available?
    - that doesn't require investigating the if of your suggestion (JDBC support)Agreed, but only because my JDBC knowledge isn't what it could be. I'd also be surprised if it doesn't support access to a named view, since they were designed to be equivalent to Tables.
    - the Op is using DAOs, so it's possible, if profiling does show this is hampering performances, to change that with no impact on the client code that calls the DAO.There's no doubt that a database solution is much higher level than a programming one; but, as I said, it's what they were designed to do. And tinkering around with program optimization has the feel of a "hacker's solution" to me. Not that there's any particular problem with that - I do it quite often when I have no control over my source - but I also try to keep in mind what the "actual" problem is.
    Winston

Maybe you are looking for

  • Raw + JPG from two cards

    With the D3, I write RAW images on one card slot and JPG to the other. When I shoot with other cameras that do not have two card slots and shoot Raw+JPG to the same card, LR is set up to treat these pairs of files as one. When I batch rename, both fi

  • ACS Replication Windows and Appliance

    We have a situation where two existing 3.2.1 ACS servers are replicated. The boxes is to be replaced by ACS appliances running 3.3.2. The problem is however that we cannot replicate between different versions. We are planning on upgrading the master

  • FTP protocol in address field

    I am able to log into and obtain files from a web site by using this command in Firefox: ftp://[email protected]:[email protected]//[email protected]:[email protected] Can any one tell me how the same thing can be done using Safari?  As it stands, th

  • RV220W and RV120W WDS / Bridge

    Have been using an RV220W for over a year and now need to create a bridge.  Have wireless and wired clients in the same building but on the level above.  I cannot run a wire, which was my first choice but that is forbidden.  SInce there are wired cli

  • Why does my iPad 2 type random letters?

    Why does my iPad 2 type random letters?