Search Results

Search found 33509 results on 1341 pages for 'good practices'.

Page 12/1341 | < Previous Page | 8 9 10 11 12 13 14 15 16 17 18 19  | Next Page >

  • Is it a oop good design ?

    - by remi bourgarel
    Hi all, I'd like to know what you think about this part of our program is realized : We have in our database a list of campsite. Partners call us to get all the campsites near a GPS location or all the campsites which provide a bar (we call it a service). So how I realized it ? Here is our database : Campsite - ID - NAME - GPS_latitude - GPS_longitude CampsiteServices -Campsite_ID -Services_ID So my code (c# but it's not relevant, let say it's an OO language) looks like this public class SqlCodeCampsiteFilter{ public string SqlCode; public Dictionary<string, object> Parameters; } interface ISQLCampsiteFilter{ SqlCodeEngineCore CreateSQLCode(); } public class GpsLocationFilter : ISQLCampsiteFilter{ public float? GpsLatitude; public float? GpsLongitude; public SqlCodeEngineCore CreateSQLCode() { --return an sql code to filter on the gps location like dbo.getDistance(@gpsLat,@gpsLong,campsite.GPS_latitude,campsite.GPS_longitude) with the parameters } } public class ServiceFilter : : ISQLCampsiteFilter{ public int[] RequiredServicesID; public SqlCodeEngineCore CreateSQLCode() { --return an sql code to filter on the services "where ID IN (select CampsiteServices.Service_ID FROm CampsiteServices WHERE Service_ID in ...) } } So in my webservice code : List<ISQLFilterEngineCore> filters = new List<ISQLFilterEngineCore>(); if(gps_latitude.hasvalue && gps_longitude.hasvalue){ filters.Add (new GpsLocationFilter (gps_latitude.value,gps_longitude.value)); } if(required_services_id != null){ filters.Add (new ServiceFilter (required_services_id )); } string sql = "SELECT ID,NAME FROM campsite where 1=1" foreach(ISQLFilterEngineCore aFilter in filters){ SqlCodeCampsiteFilter code = aFilter.CreateSQLCode(); sql += code.SqlCode; mySqlCommand.AddParameters(code.Parameters);//add all the parameters to the sql command } return mySqlCommand.GetResults(); 1/ I don't use ORM for the simple reason that the system exists since 10 years and the only dev who is here since the beginning is starting to learn about difference between public and private. 2/ I don't like SP because : we can do override, and t-sql is not so funny to use :) So what do you think ? Is it clear ? Do you have any pattern that I should have a look to ? If something is not clear please ask

    Read the article

  • Good tools for keeping the content in test/staging/live environments synchronized

    - by David Stratton
    I'm looking for recommendations on automated folder synchronization tools to keep the content in our three environments synchronized automatically. Specifically, we have several applications where a user can upload content (via a File Upload page or a similar mechanism), such as images, pdf files, word documents, etc. In the past, we had the user doing this to our live server, and as a result, our test and staging servers had to be manually synchronized. Going forward, we will have them upload content to the staging server, and we would like some software to automatically copy the files off to the test and live servers EITHER on a scheduled basis OR as the files get uploaded. I was planning on writing my own component, and either set it up as a scheduled task, or use a FileSystemWatcher, but it occurred to me that this has probably already been done, and I might be better off with some sort of synchronization tool that already exists. On our web site, there are a limited number of folders that we want to keep synchronized. In these folders, it is an all or nothing - we want to make sure the folders are EXACT duplicates. This should make it fairly straightforward, and I would think that any software that can synchronize folders would be OK, except that we also would like the software to log changes. (This rules out simple BATCH files.) So I'm curious, if you have a similar environment, how did you solve the challenge of keeping everything synchronized. Are you aware of a tool that is reliable, and will meet our needs? If not, do you have a recommendation for something that will come close, or better yet, an open source solution where we can get the code and modify it as needed? (preferably .NET). Added Also, I DID google this first, but there are so many options, I am interested mostly in knowing what actually works well vs what they SAY works, which is why I'm asking here.

    Read the article

  • A good approach to db planing for reporting service

    - by Itay Moav
    The scenario: Big system (~200 tables). 60,000 users. Complex reports that will require me to do multiple queries for each report and even those will be complex queries with inner queries all over the place + some processing in PHP. I have seen an approach, which I am not sure about: Having one centralized, de-normalized, table that registers any activity in the system which is reportable. This table will hold mostly foreign keys, so she should be fairly compact and fast. So, for example (My system is a virtual learning management system), A user enrolls to course, the table stores the user id, date, course id, organization id, activity type (enrollment). Of course I also store this data in a normalized DB, which the actual application uses. Pros I see: easy, maintainable queries and code to process data and fast retrieval. Cons: there is a danger of the de-normalized table to be out of sync with the real DB. Is this approach worth considering, or (preferably from experience) is total $#%#%t?

    Read the article

  • Good code architecture for this problem?

    - by RCIX
    I am developing a space shooter game with customizable ships. You can increase the strength of any number of properties of the ship via a pair of radar charts*. Internally, i represent each ship as a subclassed SpaceObject class, which holds a ShipInfo that describes various properties of that ship. I want to develop a relatively simple API that lets me feed in a block of relative strengths (from minimum to maximum of what the radar chart allows) for all of the ship properties (some of which are simplifications of the underlying actual set of properties) and get back a ShipInfo class i can give to a PlayerShip class (that is the object that is instantiated to be a player ship). I can develop the code to do the transformations between simplified and actual properties myself, but i would like some recommendations as to what sort of architecture to provide to minimize the pain of interacting with this translator code (i.e. no methods with 5+ arguments or somesuch other nonsense). Does anyone have any ideas? *=not actually implemented yet, but that's the plan.

    Read the article

  • How to write a good PHP database insert using an associative array

    - by Tom
    In PHP, I want to insert into a database using data contained in a associative array of field/value pairs. Example: $_fields = array('field1'=>'value1','field2'=>'value2','field3'=>'value3'); The resulting SQL insert should look as follows: INSERT INTO table (field1,field2,field3) VALUES ('value1','value2','value3'); I have come up with the following PHP one-liner: mysql_query("INSERT INTO table (".implode(',',array_keys($_fields)).") VALUES (".implode(',',array_values($_fields)).")"); It separates the keys and values of the the associative array and implodes to generate a comma-separated string . The problem is that it does not escape or quote the values that were inserted into the database. To illustrate the danger, Imagine if $_fields contained the following: $_fields = array('field1'=>"naustyvalue); drop table members; --"); The following SQL would be generated: INSERT INTO table (field1) VALUES (naustyvalue); drop table members; --; Luckily, multiple queries are not supported, nevertheless quoting and escaping are essential to prevent SQL injection vulnerabilities. How do you write your PHP Mysql Inserts? Note: PDO or mysqli prepared queries aren't currently an option for me because the codebase already uses mysql extensively - a change is planned but it'd take alot of resources to convert?

    Read the article

  • Is this SQL select code following good practice?

    - by acidzombie24
    I am using sqlite and will port to mysql (5) later. I wanted to know if I am doing something I shouldnt be doing. I tried purposely to design so I'll compare to 0 instead of 1 (I changed hasApproved to NotApproved to do this, not a big deal and I haven't written any code). I was told I never need to write a subquery but I do here. My Votes table is just id, ip, postid (I don't think I can write that subquery as a join instead?) and that's pretty much all that is on my mind. Naming conventions I don't really care about since the tables are created via reflection and is all over the place. select id, name, body, upvotes, downvotes, (select 1 from UpVotes where IPAddr=? AND post=Post.id) as myup, (select 1 from DownVotes where IPAddr=@0 AND post=Post.id) as mydown from Post where flag = '0' limit ?, ?"

    Read the article

  • What is a good balance for having developers learn at work

    - by Mel
    So now I am the manager. One of the things I always promised myself I would do is have the other developers focus on learning new stuff. In fact I even want to force them to read a couple books that really helped me learn to program. However now I am also accountable for the product getting finished. I have this vision of everyone reading books instead of working and me getting fired. What is the best way to work learning into the developers schedules, especially for the ones that just don't care to learn. How much time should be spent on learning in a work week?

    Read the article

  • Tom Kyte Webcast on Oracle Maximum Availability Architecture Best Practices - Thursday, April 12 @ 10:00 AM PDT

    - by jgelhaus
    Date: Thursday, April 12, 2012 Time: 10:00 AM PDT Update Your Knowledge with Oracle Expert Tom Kyte Data is one of the most critical assets of any organization with many operations depending on having complete and accurate data available 24/7. By implementing Oracle’s Maximum Availability Architecture (MAA), organizations can minimize the cost and risk associated with downtime. Oracle’s MAA best practices extend beyond Oracle Database to span a broad range of products, including Oracle Exadata and Oracle Database Appliance. Join Oracle expert Tom Kyte for this Live Webcast to learn how to: Protect your systems from planned and unplanned downtime Achieve the highest quality of service at the lowest cost Eliminate idle redundancy in the data center Register today and ask Tom your questions around availability best practices.

    Read the article

  • Dependency Injection/IoC container practices when writing frameworks

    - by Dave Hillier
    I've used various IoC containers (Castle.Windsor, Autofac, MEF, etc) for .Net in a number of projects. I have found they tend to encourage a number of bad practices. Are there any established practices for IoC container use, particularly when providing a platform/framework? My aim as a framework writer is to make code as simple and as easy to use as possible. I'd rather write one line of code to construct an object than ten or even just two. For example, a couple of code smells that I've noticed and don't have good suggestions to: Large number of parameters (5) for constructors. Creating services tends to be complex; all of the dependencies are injected via the constructor - despite the fact that the components are rarely optional (except for maybe in testing). Lack of private and internal classes; this one may be a specific limitation of using C# and Silverlight, but I'm interested in how it is solved. It's difficult to tell what a frameworks interface is if all the classes are public; it allows me access to private parts that I probably shouldnt touch. Coupling the object lifecycle to the IoC container. It is often difficult to manually construct the dependencies required to create objects. Object lifecycle is too often managed by the IoC framework. I've seen projects where most classes are registered as Singletons. You get a lack of explicit control and are also forced to manage the internals (it relates to the above point, all classes are public and you have to inject them). For example, .Net framework has many static methods. such as, DateTime.UtcNow. Many times I have seen this wrapped and injected as a construction parameter. Depending on concrete implementation makes my code hard to test. Injecting a dependency makes my code hard to use - particularly if the class has many parameters. How do I provide both a testable interface, as well as one that is easy to use? What are the best practices?

    Read the article

  • Good Practices for development team in large projects

    - by Moshe Magnes
    Since I started learning C a few years ago, I have never been a part of a team that worked on a project. Im very interested to know what are the best practices for writing large projects in C. One of the things i want to know, is when (not how) do I split my project into different source files. My previous experience is with writing a header-source duo (the functions defined in the header are written in the source). I want to know what are the best practices for splitting a project, and some pointers on important things when writing a project as part of a team.

    Read the article

  • Best Practices in Setting up a Build and Deployment environment for the Java Platform

    - by Genadinik
    I have a project for which "quick and dirty" isn't the best solution. What is the most stable and currently accepted set of procedures/tools that I should look into when setting up my build/deploy dev (and later production) environment? What I mean is: Should I use ANT? Or has there been something better that has evolved? In what instances should I use Maven? What are some best practices to create a continuous integration/deployment environment? What are best practices for doing test-driven development? Anything else?

    Read the article

  • Good Practices for writing large (team/solo) projects (In C)

    - by Moshe Magnes
    Since I started learning C a few years ago, I have never been a part of a team that worked on a project. Im very interested to know what are the best practices for writing large projects in C. One of the things i want to know, is when (not how) do I split my project into different source files. My previous experience is with writing a header-source duo (the functions defined in the header are written in the source). I want to know what are the best practices for splitting a project, and some pointers on important things when writing a project as part of a team.

    Read the article

  • Workflow Overview & Best Practices - EMEA

    - by Annemarie Provisero
    ADVISOR WEBCAST: Workflow Overview & Best Practices - EMEA PRODUCT FAMILY: EBS - ATG - Workflow   February 16, 2011 at 10:00 am CET, 02:30 pm India, 06:00 pm Japan, 08:00 pm Australia This 1.5-hour session is recommended for technical and functional Users who are interested to get an generic overview about the Tools and Utilities available to get a closer look into the Java Virtual Machine used in an E-Business Suite Environment and how to tune it. TOPICS WILL INCLUDE: Introduction of Workflow Useful Utilities and Tools Best Practices Q&A A short, live demonstration (only if applicable) and question and answer period will be included. Oracle Advisor Webcasts are dedicated to building your awareness around our products and services. This session does not replace offerings from Oracle Global Support Services. Click here to register for this session ------------------------------------------------------------------------------------------------------------- The above webcast is a service of the E-Business Suite Communities in My Oracle Support.For more information on other webcasts, please reference the Oracle Advisor Webcast Schedule.Click here to visit the E-Business Communities in My Oracle Support Note that all links require access to My Oracle Support.

    Read the article

  • BigQuery - Best Practices for Running Queries on Massive Datasets

    BigQuery - Best Practices for Running Queries on Massive Datasets Join Michael Manoochehri and Ryan Boyd from the big data Developer Relations team on Friday, September 21th, at 10am PDT, as they discuss best practices for answering questions about massive datasets with Google BigQuery. They'll explore interesting Big Data use cases with some of our public datasets, using BigQuery's SQL-like language to return query results in seconds. They will also cover some of BigQuery's unique query functions as well. For a general overview of BigQuery, watch our overview video: youtu.be Please use the moderator below (goo.gl to ask your questions, which will be answered live! More info here: developers.google.com From: GoogleDevelopers Views: 0 0 ratings Time: 00:00 More in Science & Technology

    Read the article

< Previous Page | 8 9 10 11 12 13 14 15 16 17 18 19  | Next Page >