Search Results

Search found 31207 results on 1249 pages for 'atg best practice in industries'.

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

  • best practices - multiple functions vs single function with switch case

    - by Amit
    I have a situation where I need to perform several small (but similar) tasks. I can think of two ways to achieve this. First Approach: function doTask1(); function doTask2(); function doTask3(); function doTask4(); Second Approach: // TASK1, TASK2, ... TASK4 are all constants function doTask(TASK) { switch(TASK) { case TASK1: // do task1 break; case TASK2: // do task2 break; case TASK3: // do task3 break; case TASK4: // do task4 break; } } A few more tasks may be added in future (though the chances are rare. but this cannot be ruled out) Please suggest which of the two approaches (or if any other) is a best practice in such a situation.

    Read the article

  • Make a Method of the Business Layer secure. best practice / best pattern [.net/c#]

    - by gsharp
    Hi We are using ASP.NET with a lot of AJAX "Page Method" calls. The WebServices defined in the Page invokes methods from our BusinessLayer. To prevent hackers to call the Page Methods, we want to implement some security in the BusinessLayer. We are struggling with two different issues. First one: public List<Employees> GetAllEmployees() { // do stuff } This Method should be called by Authorized Users with the Role "HR". Second one: public Order GetMyOrder(int orderId) { // do sutff } This Method should only be called by the owner of the Order. I know it's easy to implement the security for each method like: public List<Employees> GetAllEmployees() { // check if the user is in Role HR } or public Order GetMyOrder(int orderId) { // check if the order.Owner = user } What I'm looking for is some pattern/best practice to implement this kind of security in a generic way (without coding the the if then else every time) I hope you get what i mean :-) Thanks for you help.

    Read the article

  • Make a Method of the Business Layer secure. best practice / best pattern

    - by gsharp
    We are using ASP.NET with a lot of AJAX "Page Method" calls. The WebServices defined in the Page invokes methods from our BusinessLayer. To prevent hackers to call the Page Methods, we want to implement some security in the BusinessLayer. We are struggling with two different issues. First one: public List<Employees> GetAllEmployees() { // do stuff } This Method should be called by Authorized Users with the Role "HR". Second one: public Order GetMyOrder(int orderId) { // do sutff } This Method should only be called by the owner of the Order. I know it's easy to implement the security for each method like: public List<Employees> GetAllEmployees() { // check if the user is in Role HR } or public Order GetMyOrder(int orderId) { // check if the order.Owner = user } What I'm looking for is some pattern/best practice to implement this kind of security in a generic way (without coding the the if then else every time) I hope you get what i mean :-)

    Read the article

  • Best ways to reuse Java methods

    - by carillonator
    I'm learning Java and OOP, and have been doing the problems at Project Euler for practice (awesome site btw). I find myself doing many of the same things over and over, like: checking if an integer is prime/generating primes generating the Fibonacci series checking if a number is a palindrome What is the best way to store and call these methods? Should I write a utility class and then import it? If so, do I import a .class file or the .java source? I'm working from a plain text editor and the Mac terminal. Thanks!

    Read the article

  • Integrating application ad-support - best practice

    - by Jarede
    Considering the review that came out in March: Researchers from Purdue University in collaboration with Microsoft claim that third-party advertising in free smartphone apps can be responsible for as much as 65 percent to 75 percent of an app's energy consumption. Is there a best practice for integrating advert support into mobile applications, so as to not drain user battery too much. When you fire up Angry Birds on your Android phone, the researchers found that the core gaming component only consumes about 18 percent of total app energy. The biggest battery suck comes from the software powering third-party ads and analytics accounting for 45 percent of total app energy, according to the study. Has anyone invoked better ways of keeping away from the "3G Tail", as the report puts it. Is it better/possible to download a large set of adverts that are cached for a few hours, and using them to populate your ad space, to avoid constant use of the wifi/3g radios. Are there any best practices for the inclusion of adverts in mobile apps?

    Read the article

  • For a Javascript library, what is the best or standard way to support extensibility

    - by Michael Best
    Specifically, I want to support "plugins" that modify the behavior of parts of the library. I couldn't find much information on the web about this subject. But here are my ideas for how a library could be extensible. The library exports an object with both public and "protected" functions. A plugin can replace any of those functions, thus modifying the library's behavior. Advantages of this method are that it's simple and that the plugin's functions can have full access to the library's "protected" functions. Disadvantages are that the library may be harder to maintain with a larger set of exposed functions and it could be hard to debug if multiple plugins are involved (how to know which plugin modified which function?). The library provides an "add plugin" function that accepts an object with a specific interface. Internally, the library will use the plugin instead of it's own code if appropriate. With this method, the internals of the library can be rearranged more freely as long as it still supports the same plugin interface. This could also support having different plugin interfaces to modify different parts of the library. A disadvantage of this method is that the plugins may have to re-implement code that is already part of the library since the library's internal functions are not exported. The library provides a "set implementation" function that accepts an object inherited from a specific base object. The library's public API calls functions in the implementation object for any functionality that can be modified and the base implementation object includes the core functionality, with both external (to the API) and internal functions. A plugin creates a new implementation object, which inherits from the base object and replaces any functions it wants to modify. This combines advantages and disadvantages of both the other methods.

    Read the article

  • What are MEF best practices?

    - by Sorskoot
    What are some best practices for using MEF in your code? Are there any pitfalls to take into account when starting your extensible application? Did you run into anything you should have known earlier?

    Read the article

  • Best practices concerning view model and model updates with a subset of the fields

    - by Martin
    By picking MVC for developing our new site, I find myself in the midst of "best practices" being developed around me in apparent real time. Two weeks ago, NerdDinner was my guide but with the development of MVC 2, even it seems outdated. It's an thrilling experience and I feel privileged to be in close contact with intelligent programmers daily. Right now I've stumbled upon an issue I can't seem to get a straight answer on - from all the blogs anyway - and I'd like to get some insight from the community. It's about Editing (read: Edit action). The bulk of material out there, tutorials and blogs, deal with creating and view the model. So while this question may not spell out a question, I hope to get some discussion going, contributing to my decision about the path of development I'm to take. My model represents a user with several fields like name, address and email. All the names, in fact, on field each for first name, last name and middle name. The Details view displays all these fields but you can change only one set of fields at a time, for instance, your names. The user expands a form while the other fields are still visible above and below. So the form that is posted back contains a subset of the fields representing the model. While this is appealing to us and our layout concerns, for various reasons, it is to be shunned by serious MVC-developers. I've been reading about some patterns and best practices and it seems that this is not in key with the paradigm of viewmodel == view. Or have I got it wrong? Anyway, NerdDinner dictates using FormCollection och UpdateModel. All the null fields are happily ignored. Since then, the MVC-community has abandoned this approach to such a degree that a bug in MVC 2 was not discovered. UpdateModel does not work without a complete model in your formcollection. The view model pattern receiving most praise seems to be Dedicated view model that contains a custom view model entity and is the only one that my design issue could be made compatible with. It entails a tedious amount of mapping, albeit lightened by the use of AutoMapper and the ideas of Jimmy Bogard, that may or may not be worthwhile. He also proposes a 1:1 relationship between view and view model. In keeping with these design paradigms, I am to create a view and associated view for each of my expanding sets of fields. The view models would each be nearly identical, differing only in the fields which are read-only, the views also containing much repeated markup. This seems absurd to me. In future I may want to be able to display two, more or all sets of fields open simultaneously. I will most attentively read the discussion I hope to spark. Many thanks in advance.

    Read the article

  • LDAP Best Practices

    - by Vik Gamov
    Hi, there. I'm interesting in best practices of using LDAP authentication in java-based web application. In my app I don't want to store username\password, only some id. But, I want retrieve addition information (Name, Last name) if any exists on LDAP catalog.

    Read the article

  • Best way to define an immutable class in Objective C

    - by Patrick Marty
    Hi, I am a newbie in Objective C and I was wondering what is the best way to define an immutable class in Objective-C (like NSString for example). I want to know what are the basic rules one has to follow to make a class immutable. I think that : setters shouldn't be provided if properties are used, they should be readonly accessInstanceVariablesDirectly must be override and return NO Did I forget something ? Thanks

    Read the article

  • Best practices for custom http user-agent strings?

    - by Noufal Ibrahim
    I'm developing an application that communicates with an internal web service using HTTP. Are there any "best practices" for custom user-agent strings so that I can put a nice one in my app? It's a Python library and the lower transport is Python's own httplib. Should the user-agent string say that or something else?

    Read the article

  • Cruise Control.Net best practices

    - by Nasser Hajloo
    I'm going to implement a CI process with CC.NET so I'm looking for best practices for CC.net implementation. I use SVN as source control and JIRA as an issue tracker (if it's a useful tip). Any recommandation or article suggestion will be appreciated. Note: I read this article by Martin Fowler.

    Read the article

  • Best practices for model driven development using LiveCycle Data Services

    - by Adnan
    What are your advises on using model driven development in developing enterprise applications. Adobe's LiveCycle Data Services looks very promising, I have found numerous tutorials/videos that shows how fast an application can be build by having methods/functions auto-generated. What are the best-practices, is it good/bad to use those auto-generated methods, they can really save a lot of time. All suggestions are welcome, also if you know some existing blog/discussion please let me know.

    Read the article

  • What are the best practices for avoid xss attacks in a PHP site

    - by rikh
    I have PHP configured so that magic quotes are on and register globals are off. I do my best to always call htmlentities() for anything I am outputing that is derived from user input. I also occasionally seach my database for common things used in xss attached such as... <script What else should I be doing and how can I make sure that the things I am trying to do are always done.

    Read the article

  • Nested Functions in C - Best Practices

    - by Justin Ethier
    I just realized a function may be defined inside another function in C: void main(){ int foo(){ return 2; }; printf("%d\n", foo()); } Besides being a neat trick, the useful thing about this is that the inner function is private to the outer function. But... is that a good enough reason to do this in a "real-world" application? What are the best practices for using this syntax?

    Read the article

  • PHP best practices for naming conventions

    - by alex
    I recently started these naming conventions.. all functions & variables = camelCase constants with define() = ALL_CAPS_AND_UNDERSCORES Now I see a lot of other people mix up camelCase and underscores and they seem to have some sort of convention to it... What do you use and what is best? I've heard that public and private functions should have underscores before some.. I assume private have 2 underscores as in __construct() ? Thank you!

    Read the article

  • Best practices for developing simple ASP.NET sites (built in controls or JQuery + scripts)

    - by Nix
    I was recently reviewing some code written by two different contractors, both were basic ASP.NET management sites. The sites allowed the user to view and edit data. Pretty much simple CRUD gateways. One group did their best to use built in ASP + AJAX Toolkit controls and did their best to use as many built in controls as possible. I found the code much easier to read and maintain. The other used jQuery and the code is heavily marked up with script blocks which are then used to build pages from javascript files. Which one is more common? The one that basically leveraged embedded HTML markup in scripts controled by javascript files screams readability and maintenance issues? Is this just the way of doing asp dev with jQuery? Assuming the second example happens a lot, are there tools that help facilitate jQuery development with visual studio? Do you think they generated the html somewhere else and just copied it in? Example Script block: <script id="HRPanel" type="text/html"> <table cellpadding='0' cellspacing='0' class="atable"><thead class="mHeader"><tr><th>Name</th><th>Description</th><th>Other</th></thead><tbody> <# for(var i=0; i < hrRows.length; i++) { var r = HRRows[i]; #> <tr><td><#=r.Name#></td><td><#=r.Description#></td><td class="taRight"><#=r.Other#></td></tr> <#}#> </tbody><tfoot><th></th><th></th><th></th></tfoot></table> </script> Then in a separate location (js file) you would see something like this. $("#HRPanel").html($("#HRPanel").parseTemplate({ HRRows: response.something.bah.bah }));

    Read the article

  • Best way to ensure accurate timing with C

    - by Paul
    I am a beginning C programmer (though not a beginning programmer) looking to dive into a project to teach myself C. My project is music-based, and because of this I am curious whether there are any 'best practices' per-se, when it comes to timing functions.

    Read the article

  • Best way to store configuration settings outside of web.config

    - by Wil
    I'm starting to consider creating a class library that I want to make generic so others can use it. While planning it out, I came to thinking about the various configuration settings that I would need. Since the idea is to make it open/shared, I wanted to make things as easy on the end user as possible. What's the best way to setup configuration settings without making use of web.config/app.config?

    Read the article

  • Are there any good references coparing Software Development CM best practices to IT CM best practice

    - by dkackman
    I have spent my career on the software development side of things and in the latter part have become more and more involved in the realm of Software Configuration Management. Now I am moving into an IT group and need to ramp up on CM practices from that standpoint. Are there any good references (books, websites, blogs whatever) out there comparing Software CM practices to IT CM practices? Basically I'm in learning mode and am trying compare things I already know from the software development side to things on the IT side.

    Read the article

  • Best practices for using the Entity Framework with WPF DataBinding

    - by Ken Smith
    I'm in the process of building my first real WPF application (i.e., the first intended to be used by someone besides me), and I'm still wrapping my head around the best way to do things in WPF. It's a fairly simple data access application using the still-fairly-new Entity Framework, but I haven't been able to find a lot of guidance online for the best way to use these two technologies (WPF and EF) together. So I thought I'd toss out how I'm approaching it, and see if anyone has any better suggestions. I'm using the Entity Framework with SQL Server 2008. The EF strikes me as both much more complicated than it needs to be, and not yet mature, but Linq-to-SQL is apparently dead, so I might as well use the technology that MS seems to be focusing on. This is a simple application, so I haven't (yet) seen fit to build a separate data layer around it. When I want to get at data, I use fairly simple Linq-to-Entity queries, usually straight from my code-behind, e.g.: var families = from family in entities.Family.Include("Person") orderby family.PrimaryLastName, family.Tag select family; Linq-to-Entity queries return an IOrderedQueryable result, which doesn't automatically reflect changes in the underlying data, e.g., if I add a new record via code to the entity data model, the existence of this new record is not automatically reflected in the various controls referencing the Linq query. Consequently, I'm throwing the results of these queries into an ObservableCollection, to capture underlying data changes: familyOC = new ObservableCollection<Family>(families.ToList()); I then map the ObservableCollection to a CollectionViewSource, so that I can get filtering, sorting, etc., without having to return to the database. familyCVS.Source = familyOC; familyCVS.View.Filter = new Predicate<object>(ApplyFamilyFilter); familyCVS.View.SortDescriptions.Add(new System.ComponentModel.SortDescription("PrimaryLastName", System.ComponentModel.ListSortDirection.Ascending)); familyCVS.View.SortDescriptions.Add(new System.ComponentModel.SortDescription("Tag", System.ComponentModel.ListSortDirection.Ascending)); I then bind the various controls and what-not to that CollectionViewSource: <ListBox DockPanel.Dock="Bottom" Margin="5,5,5,5" Name="familyList" ItemsSource="{Binding Source={StaticResource familyCVS}, Path=., Mode=TwoWay}" IsSynchronizedWithCurrentItem="True" ItemTemplate="{StaticResource familyTemplate}" SelectionChanged="familyList_SelectionChanged" /> When I need to add or delete records/objects, I manually do so from both the entity data model, and the ObservableCollection: private void DeletePerson(Person person) { entities.DeleteObject(person); entities.SaveChanges(); personOC.Remove(person); } I'm generally using StackPanel and DockPanel controls to position elements. Sometimes I'll use a Grid, but it seems hard to maintain: if you want to add a new row to the top of your grid, you have to touch every control directly hosted by the grid to tell it to use a new line. Uggh. (Microsoft has never really seemed to get the DRY concept.) I almost never use the VS WPF designer to add, modify or position controls. The WPF designer that comes with VS is sort of vaguely helpful to see what your form is going to look like, but even then, well, not really, especially if you're using data templates that aren't binding to data that's available at design time. If I need to edit my XAML, I take it like a man and do it manually. Most of my real code is in C# rather than XAML. As I've mentioned elsewhere, entirely aside from the fact that I'm not yet used to "thinking" in it, XAML strikes me as a clunky, ugly language, that also happens to come with poor designer and intellisense support, and that can't be debugged. Uggh. Consequently, whenever I can see clearly how to do something in C# code-behind that I can't easily see how to do in XAML, I do it in C#, with no apologies. There's been plenty written about how it's a good practice to almost never use code-behind in WPF page (say, for event-handling), but so far at least, that makes no sense to me whatsoever. Why should I do something in an ugly, clunky language with god-awful syntax, an astonishingly bad editor, and virtually no type safety, when I can use a nice, clean language like C# that has a world-class editor, near-perfect intellisense, and unparalleled type safety? So that's where I'm at. Any suggestions? Am I missing any big parts of this? Anything that I should really think about doing differently?

    Read the article

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