Search Results

Search found 1399 results on 56 pages for 'separation of concerns'.

Page 5/56 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • Command Query Separation validating for retries

    - by Neil Barnwell
    So I'm comfortable with the basic concept of CQS, where you might have a command that writes to one database, and that updates the query database that you read from. However, consider the scenario where you are entering data, and want to prevent duplicates. Using new employee data entry an employee register as an example, working through a pile of application forms to key in the new employees' details: Take top sheet. Key in employee name and unique payroll number to UI. Submit. Put paper in "completed pile". Repeat. How would you now prevent the user from keying in the same payroll number again, say for instance if they get distracted and can't remember whether they've keyed one in already and the "message" hasn't got all the way back to the query db for the user to search?

    Read the article

  • Separation of business logic

    - by bruno
    When I was optimizing my architecture of our applications in our website, I came to a problem that I don't know the best solution for. Now at the moment we have a small dll based on this structure: Database <-> DAL <-> BLL the Dal uses Business Objects to pass to the BLL that will pass it to the applications that uses this dll. Only the BLL is public so any application that includes this dll, can see the bll. In the beginning, this was a good solution for our company. But when we are adding more and more applications on that Dll, the bigger the Bll is getting. Now we dont want that some applications can see Bll-logic from other applications. Now I don't know what the best solution is for that. The first thing I thought was, move and separate the bll to other dll's which i can include in my application. But then must the Dal be public, so the other dll's can get the data... and that I seems like a good solution. My other solution, is just to separate the bll in different namespaces, and just include only the namespaces you need in the applications. But in this solution, you can get directly access to other bll's if you want. So I'm asking for your opinions.

    Read the article

  • Need some advice on MVC separation..

    - by Zenph
    I should note I am using Zend Framework. Although this shouldn't affect the concrete answer, it does mean there are several places I can implement my following method (action helper, controller etc). The issue is I have buildOptions() and parseOptions() method which takes $_GET/$_POST variables based on a 'tag' and builds rules which are then used in a select query. An example would be ?modelSort=id&modelOrder=asc The 'model' in the above obviously relates to the particular model, and it used as a 'tag' so that I can for example also have model2Sort and model2Order so there is no conflict between parameters. However, the trouble I am having now is where should these methods go? They are generally dealing with request params. I have been reading a lot about fat model, thin controller. Should this be in an abstract model. My thinking was that if it were, I would do something like: (note, I know I wouldn't call directly like this. Method would be used by child classes) $abstractModel-buildOptions($params); Where 'params' could be anything, like the request parameters $_GET or $_POST: $abstractModel-buildOptions($_GET); Now from what I can see the model is not inherintly dealing with request variables but rather parameters passed to the method. Advice? Where does this method belong? Model, Controller? Specifically on Zend, should it be an action helper, plugin, within an abstract model? Appreciate any advice.

    Read the article

  • Security concerns for a multi-lingual web application.

    - by The Rook
    I am converting a PHP MySQL web application written for English language into a Multi-Language site. Do you know any vulnerabilities that affect web applications in another language? Or perhaps vulnerabilities that could be introduced in the conversion of code base to support multiple languages. (If you know any vulnerabilities of this type in another programming language I'll give you a +1)

    Read the article

  • Can Separation of Duties Deter Cybercrime? YES!

    - by roxana.bradescu
    According to the CERT 2010 CyberSecurity Watch Survey: The public may not be aware of the number of incidents because almost three-quarters (72%), on average, of the insider incidents are handled internally without legal action or the involvement of law enforcement. However, cybercrimes committed by insiders are often more costly and damaging than attacks from outside. When asked what security policies and procedures supported or played a role in the deterrence of a potential cybercriminal, 36% said technically-enforced segregation of duties. In fact, many data protection regulations call for separation of duties and enforcement of least privilege. Oracle Database Security solutions can help you meet these requirements and prevent insider threats by preventing privileged IT staff from accessing the data they are charged with managing, ensuring developers and testers don't have access to production data, making sure that all database activity is monitored and audited to prevent abuse, and more. All without changes to your existing applications or costly infrastructure investments. To learn more, watch our Oracle Database Management Separation of Duties for Security and Regulatory Compliance webcast.

    Read the article

  • Validating disconnected POCOs

    - by jonathanconway
    In my ASP.NET application I have separate projects for the Data, Business and UI layers. My business layer is composed of plain objects with declarative validation, using DataAnnotations. Problem is, when it comes to save them, I'm not sure how to process the validation, since they're not bound directly to any data context, but rather, are mapped to separate data-layer objects. Is there a way to trigger validation on these kinds of objects?

    Read the article

  • Unit test complex classes with many private methods

    - by Simon G
    Hi, I've got a class with one public method and many private methods which are run depending on what parameter are passed to the public method so my code looks something like: public class SomeComplexClass { IRepository _repository; public SomeComplexClass() this(new Repository()) { } public SomeComplexClass(IRepository repository) { _repository = repository; } public List<int> SomeComplexCalcualation(int option) { var list = new List<int>(); if (option == 1) list = CalculateOptionOne(); else if (option == 2) list = CalculateOptionTwo(); else if (option == 3) list = CalculateOptionThree(); else if (option == 4) list = CalculateOptionFour(); else if (option == 5) list = CalculateOptionFive(); return list; } private List<int> CalculateOptionOne() { // Some calculation } private List<int> CalculateOptionTwo() { // Some calculation } private List<int> CalculateOptionThree() { // Some calculation } private List<int> CalculateOptionFour() { // Some calculation } private List<int> CalculateOptionFive() { // Some calculation } } I've thought of a few ways to test this class but all of them seem overly complex or expose the methods more than I would like. The options so far are: Set all the private methods to internal and use [assembly: InternalsVisibleTo()] Separate out all the private methods into a separate class and create an interface. Make all the methods virtual and in my tests create a new class that inherits from this class and override the methods. Are there any other options for testing the above class that would be better that what I've listed? If you would pick one of the ones I've listed can you explain why? Thanks

    Read the article

  • How do I design a Wizard-based system with SoC in mind?

    - by Erik Forbes
    I'm building a Windows Forms system (in C# if it matters to anyone) that provides an application automation service. As this application is targeted at users who are not computer savvy, I've decided to break up the functions of the application into various tasks, and provide these tasks via a wizard UI. I'd like to avoid coupling the views and view engine (from which the Wizard will be built) to the automation engine. The problem I'm having is that the automation engine, which runs on a separate thread while it does its thing, needs to report status information back to the user, as well as listen for cancel or pause events from the user. Since I don't want the view engine or the automation engine to rely on each other, I'm having a hard time figuring out how to provide for this information conduit. Any insights into this issue I'm having would be greatly appreciated. I've been wracking my brain for a couple weeks now on this point, and I really don't want to give up and just couple everything together. If anyone needs additional details to help come up with some sort of idea please let me know and I'll be happy to provide them.

    Read the article

  • Separating Content (aspx) from Code (aspx.cs) in ASP.NET

    - by firedrawndagger
    I would like to know what is the best practice on separating the content of an aspx page (ASP.NET 3.5) from the code (I'm using C#). I have a form that users can type data in - for example they are allowed to enter a percent. If they Otherwise for example I would like to display the following error messages: <p id="errormsg" class="percenthigh">Please enter a percent below 100</p> <p id="errormsg" class="percentnegative">Percent cannot be below 0</p> <p id="errormsg" class="percentnot">This is not a percent</p> So in essence I'm hiding the error messages and showing one depending on what the user input is. I believe this is the best way to seperate the content from the code behind. However, how do I select elements and hide/unhide them depending on the user input? I'm aware I can do a runat="server" on the elements but the problem is that I can't select by class and am limited only to ID's. What workarounds do you recommend? Aside from putting in the values in code behind which is notoriously difficult to debug. Also has this been "fixed" in ASP.NET 4?

    Read the article

  • Attributes in XML subtree that belong to the parent

    - by Bart van Heukelom
    Say I have this XML <doc:document> <objects> <circle radius="10" doc:colour="red" /> <circle radius="20" doc:colour="blue" /> </objects> </doc:document> And this is how it is parsed (pseudo code): // class DocumentParser public Document parse(Element edoc) { doc = new Document(); doc.objects = ObjectsParser.parse(edoc.getChild("objects")); for ( ...?... ) { doc.objectColours.put(object, colour); } return doc; } ObjectsParser is responsible for parsing the objects bit, but is not and should not be aware of the existence of documents. However, in Document colours are associated with objects by use of a Map. What kind of pattern would you recommend to give the colour settings back to DocumentParser.parse from ObjectsParser.parse so it can associate it with the objects they belong to in a map? The alternative would be something like this: <doc:document> <objects> <circle id="1938" radius="10" /> <circle id="6398" radius="20" /> </objects> <doc:objectViewSettings> <doc:objectViewSetting object="1938" colour="red" /> <doc:objectViewSetting object="6398" colour="blue" /> </doc:objectViewSettings> </doc:document> Ugly!

    Read the article

  • How do you keep application logic separate from UI when UI components have built-in functionality?

    - by Al C
    I know it's important to keep user interface code separated from domain code--the application is easier to understand, maintain, change, and (sometimes) isolate bugs. But here's my mental block ... Delphi comes with components with methods that do what I want, e.g., a RichText Memo component lets me work with rich text. Other components, like TMS's string grid not only do what I want, but I paid extra for the functionality. These features put the R in RAD. It seems illogical to write my own classes to do things somebody else has already done for me. It's reinventing the wheel [ever tried working directly with rich text? :-) ] But if I use the functionality built into components like these, then I will end up with lots of intermingled UI and domain code--I'll have a form with most of my code built into its event handlers. How do you deal with this issue? ... Or, if I want to continue using the code others have already written for me, how would you suggest I deal with the issue?

    Read the article

  • How to access Session values from layers beneath the web application layer.

    - by Matthew Vines
    We have many instances in our application where we would like to be able to access things like the currently logged in user id in our business domain and data access layer. On log we push this information to the session, so all of our front end code has access to it fairly easily of course. However, we are having huge issues getting at the data in lower layers of our application. We just can't seem to find a way to store a value in the business domain that has global scope just for the user (static classes and properties are of course shared by the application domain, which means all users in the session share just one copy of the object). We have considered passing in the session to our business classes, but then our domain is very tightly coupled to our web application. We want to keep the prospect of a winforms version of the application possible going forward. I find it hard to believe we are the first people to have this sort of issue. How are you handling this problem in your applications?

    Read the article

  • assembling an object graph without an ORM -- in the service layer or data layer?

    - by Hans Gruber
    At my current gig, our persistence layer uses IBatis going against SQL Server stored procedures (puke). IMHO, this approach has many disadvantages over the use of a "true" ORM such NHibernate or EF, but the one I'm trying to address here revolves around all the boilerplate code needed to map data from a result set into an object graph. Say I have the following DTO object graph I want to return to my presentation layer: IEnumerable<CustomerDTO> |--> IEnumerable<AddressDTO> |--> LatestOrderDTO The way I've implemented this is to have a discrete method in my DAO class to return each IEnumerable<*DTO>, and then have my service class be responsible for orchestrating the calls to the DAO. It then returns the fully assembled object graph to the client: public class SomeService(){ public SomeService(IDao someDao){ this._someDao = someDao; } public IEnumerable<CustomerDTO> ListCustomersForHistory(int brokerId){ var customers = _someDao.ListCustomersForBroker(brokerId); foreach (customer in customers){ customer.Addresses = someDao.ListCustomersAddresses(brokerId); customer.LatestOrder = someDao.GetCustomerLatestOrder(brokerId); } } return customers; } My question is should this logic belong in the service layer or the should I make my DAO such that it instead returns the assembled object graph. If I was using NHibernate, I assume that this kind of relationship association between objects comes for "free"?

    Read the article

  • Which Open Source Licenses can address concerns for an Open Source Game Engine?

    - by Chris
    I am on a team that is looking to open source an engine we are building. It's intended as an engine for Online RPG style games. We're writing it to work on both desktops and android platforms. I've been over to the OSI http://opensource.org/licenses/category to check out the most common licenses. However, this will be my first time going into an open source project and I wanted to know if the community had some insight into which licenses might be best suited. Key licensing concerns: Removing or limiting our liability (most already seem to cover this, but stating for completeness). We want other developers to be able to take part or all of our project and use it in their own projects with proper accreditation to our project. Licensing should not hinder someone's ability to quickly use the engine. They should be able to download a release and start using it without needing to wait on licensing issues. Game content (gfx, sound, etc.) that is not part of the engine should be allowed to be licensed separately. If someone is using our engine, they can retain full copy right of their content, including engine generated data. Our primary goal is exposure, which is why we're going open source to start with. Both for the project and for the individuals developing it. Are there any licenses that can require accreditation visible to players? While I'd put our primary goal as exposure, for licensing the accreditation is less of a concern. From what I've read through (and have been able to understand) it doesn't seem like any of the licenses cover anything that is produced by the licensed software. Are there any that state this specifically, or does simply not mentioning it leave it open for other licensing? Are there any other concerns that we should consider? Has anyone had any issues using any of these licenses?

    Read the article

  • Why does this article state that graduate education liberate one from concerns like the efficiency of hardware-based integers?

    - by kadaj
    Quoting The Evolution of Haskell Programmer, graduate education tends to liberate one from petty concerns about, e.g., the efficiency of hardware-based integers What exactly does this suggest? Is it that after graduation, one gets more interested in abstract ideas so much that he does not think hardware is relevant? Or that hardware is also abstracted and one is more interested in algorithms? I am trying to understand on what grounds the sentence is based.

    Read the article

  • Building Enterprise Smartphone App &ndash; Part 3: Key Concerns

    - by Tim Murphy
    This is part 3 in a series of posts based on a talk I gave recently at the Chicago Information Technology Architects Group.  Feel free to leave feedback. Keys Concerns Of Smartphones In The Enterprise These are the factors that you need to be aware of and address in order to build successful enterprise smartphone applications.  Most of them have nothing to do with the application itself as you will see here. Managing Devices Managing devices is a factor that is going to effect how much your company will have to spend outside of developing the applications.  How will you track the devices within the corporation?  How often will you have to replace phones and as a consequence have to upgrade your applications to support new phones?  The devices can represent a significant investment of capital.  If these questions are not addressed you will find a number of hidden costs throughout the life of your solution. Purchase or BYOD We have seen the trend of Bring Your Own Device (BYOD) lately within the enterprise.  How many meetings have you been in where someone is on their personal iPad, iPhone, Android phone or Windows Phone?  The issue is if you can afford to support everyone's choice in device? That is a lot to take on even if you only support the current release of each platform. Do you go with the most popular device or do you pick a platform that best matches your current ecosystem and distribute company owned devices?  There is no easy answer here, but you should be able give some dollar value to both hardware and development costs related to platform coverage. Asset Tracking/Insurance Smartphones are devices that are easier to lose or have stolen than laptops and desktops. Not only do you have your normal asset management concerns but also assignment of financial responsibility. You also will need to insure them against damage and theft and add legal documents that spell out the responsibilities of the employees that use these devices. Personal vs. Corporate Data What happens when you terminate an employee?  How do you recover the device?  What happens when they have put personal data on the device?  These are all situation that can cause possible loss of corporate intellectual property or legal repercussions of reclaiming a device with personal data on it.  Policies need to be put in place that protect the company from being exposed to type of loss.  This can mean significant legal and procedural cost that you need to consider. Coming Up In the last installment of this series I will cover application development considerations. del.icio.us Tags: Smartphones,Enterprise Smartphone Apps,Architecture

    Read the article

  • CQRS - Should a Command try to create a "complex" master-detail entity?

    - by Simon Crabtree
    I've been reading Greg Young and Udi Dahan's thoughts on Command Query Responsibilty Separation and a lot of what I read strikes a chord with me. My domain (we track vehicles which are doing deliveries) has the concept of a Route which contains one or more Stops. I need my customers to be able to set these up in our system by calling a webservice, and then be able to retrieve information about a Route and how the vehicle is progressing. In the past I would have "cut-down" DTO classes which closely resemble my domain classes, and the customer would create a RouteDto with an array of StopDto(s), and call our CreateRoute webmethod, passing in the RouteDto. When they query our system by calling the GetRouteDetails method, I would return exactly the same objects to them. One of the appealing aspects of CQRS is that the RouteDto might have all manner of properties that the customer wants to query, but have no business setting when they create a Route. So I create a separate CreateRouteRequest class which is passed in when calling the CreateRoute "command", and a Route DTO class which gets returned as a query result. class Route{ string Reference; List<Stop> Stops; } But I need my customer to provide me with Route AND Stop details when they create a route. As I see it I could either... Give my CreateRouteRequest class a Stops(s) property which is an array of "something" representing the data they need to provide about each stop - but what do I call this class? It's not a Stop as that's what I'm calling the list of DTO inside my Route DTO, but I don't like "CreateStopRequest". I also wonder if I'm stuck in a CRUD mindset here thinking in terms of master-detail information and asking the customer to think like that too. class CreateRouteRequest{ string Reference; ... List<CreateStopRequest> Stops; } or They call CreateRoute, and then make a number of calls to an AddStopToRoute method. This feels a bit more "behavioural" but I'm going to lose the ability to treat creating a route including its stops as a single atomic command. If they create a Route and then try to add a Stop which fails due to some validation problem they're going to have a partially correct Route. The fact that I can't come up with a good name for the list of "StopCreationData" objects I'd be working with in option 1, makes me wonder if there's something I'm missing.

    Read the article

  • Are there Any Concerns with Importing Document Files From a Competing Product?

    - by Thunderforge
    I have a new product that serves the same purpose as my competitor's long-standing product. One thing I have considered doing is allowing my program to import document files created by their product in order to provide an easy way for users to migrate towards mine. Naturally, this would be done without the competitor's permission, as it goes against their interests. I've seen this done before with office suite software (e.g. Open Office and Apple Pages can import MS Word documents), but I'm wondering if there are any concerns, legal or ethical, with me doing this. I fully expect any answers will most likely fall under the "I am not a lawyer" clause, but it would be helpful to have a starting point for anything I would need to be aware of, or if I shouldn't need to worry.

    Read the article

  • Does command/query separation apply to a method that creates an object and returns its ID?

    - by Gilles
    Let's pretend we have a service that calls a business process. This process will call on the data layer to create an object of type A in the database. Afterwards we need to call again on another class of the data layer to create an instance of type B in the database. We need to pass some information about A for a foreign key. In the first method we create an object (modify state) and return it's ID (query) in a single method. In the second method we have two methods, one (createA) for the save and the other (getId) for the query. public void FirstMethod(Info info) { var id = firstRepository.createA(info); secondRepository.createB(id); } public void SecondMethod(Info info) { firstRepository.createA(info); var key = firstRepository.getID(info); secondRepository.createB(key); } From my understanding the second method follows command query separation more fully. But I find it wasteful and counter-intuitive to query the database to get the object we have just created. How do you reconcile CQS with such a scenario? Does only the second method follow CQS and if so is it preferable to use it in this case?

    Read the article

  • How to choose between Tell don't Ask and Command Query Separation?

    - by Dakotah North
    The principle Tell Don't Ask says: you should endeavor to tell objects what you want them to do; do not ask them questions about their state, make a decision, and then tell them what to do. The problem is that, as the caller, you should not be making decisions based on the state of the called object that result in you then changing the state of the object. The logic you are implementing is probably the called object’s responsibility, not yours. For you to make decisions outside the object violates its encapsulation. A simple example of "Tell, don't Ask" is Widget w = ...; if (w.getParent() != null) { Panel parent = w.getParent(); parent.remove(w); } and the tell version is ... Widget w = ...; w.removeFromParent(); But what if I need to know the result from the removeFromParent method? My first reaction was just to change the removeFromParent to return a boolean denoting if the parent was removed or not. But then I came across Command Query Separation Pattern which says NOT to do this. It states that every method should either be a command that performs an action, or a query that returns data to the caller, but not both. In other words, asking a question should not change the answer. More formally, methods should return a value only if they are referentially transparent and hence possess no side effects. Are these two really at odds with each other and how do I choose between the two? Do I go with the Pragmatic Programmer or Bertrand Meyer on this?

    Read the article

  • How To Implement The Query Side Of CQS in DDD?

    - by Laz
    I have implemented the command side of DDD using the domain model and repositories, but how do I implement the query side? Do I create an entirely new domain model for the UI, and where is this kept in the project structure...in the domain layer, the UI layer, etc? Also, what do I use as my querying mechanism, do I create new repositories specifically for the UI domain objects, something other than repositories, or something else?

    Read the article

  • TypeScript - separating code output

    - by Andrea Baccega
    i'm trying typescript and I find it very useful. I've a quite large project and i was considering rewriting it using typescript. The main problem here is the following: file A.ts: class A extends B { // A stuff } file B.ts: class B { // B stuff } If I compile A.ts with this command: tsc --out compiledA.js A.ts I'll get error from the compiler cause he doesn't know how to threat the "B" after extends. So, a "solution" would be including in A.ts (as first line of code): /// <reference path="./B.ts" /> Compiling again A.ts with the same command tsc --out compiledA.js A.ts Will result in compiledA.js containing both B.ts and A.ts code. ( which could be very nice ) In my case, I only need to compile the A.ts code in the compiledA.js file and I don't want the B.ts stuff to be in there. Indeed, what I want is: tsc --out A.js A.ts = compile only the A.ts stuff tsc --out B.js B.ts = compile only the B.ts stuff I can do it by removing the "extends" keyword but doing that I'll loose most of the typescript goodness. Can someone telll me if there's a way to do this ?

    Read the article

  • How do I remove separation between rows in a HTML table?

    - by Roman
    I have a html table with 3 rows and 1 column. In the top and button row I have images and in the middle row I have div. Between my rows I see a separation (I see background of my page). I tried to set all padding and margins to zero (for tables, div and images) and I still have this separation. Can anybody, please, help me to solve this problem. The page is here:

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >