Search Results

Search found 3698 results on 148 pages for 'dependency injection'.

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

  • Are multiline queries sql-injection safe?

    - by acmatos
    This might be a stupid question. Or maybe my hacking skills are limited (I don't practice them at all). I have a query that looks like this: <?php $query =<<<eot SELECT table_x.field1, table_x.field2, table_y.*, table_z.field4 FROM ( SELECT ... ) as table_y LEFT JOIN table_x ON table_x.field1 = table_y.field_x LEFT JOIN table_z ON table_z.field1 = table_y.field_z WHERE table_x.field3 = '$something' AND table_z.field4 = '1' AND table_z.field5 = '2' eot; ?> I have a lot of other tests on $something before it gets used, like $something = explode(' ',$something); (which later result in a string) none of them intend to prevent injection but they make it hard for the given injection to get as is to the actual query. However, there are ways. We all know how easy it is to replace a space for something else which is still valid.. So, it's not really a problem to make a potentially harmful piece of SQL reach that $something... But is there any way to comment the rest of the original query string if it is multi-line? I can comment AND table_z.field4 = '1' using ;-- but can't comment the following AND table_z.field5 = '2' Is it possible to open a multi-line comment /* without closing it or something looked like and therefore allow the injection to ignore the multi-line query?

    Read the article

  • Unity 1.2 Dependency injection of internal types

    - by qvin
    I have a facade in a library that exposes some complex functionality through a simple interface. My question is how do I do dependency injection for the internal types used in the facade. Let's say my C# library code looks like - public class XYZfacade:IFacade { [Dependency] internal IType1 type1 { get; set; } [Dependency] internal IType2 type2 { get; set; } public string SomeFunction() { return type1.someString(); } } internal class TypeA { .... } internal class TypeB { .... } And my website code is like - IUnityContainer container = new UnityContainer(); container.RegisterType<IType1, TypeA>(); container.RegisterType<IType2, TypeB>(); container.RegisterType<IFacade, XYZFacade>(); ... ... IFacade facade = container.Resolve<IFacade>(); Here facade.SomeFunction() throws an exception because facade.type1 and facade.type2 are null. Any help is appreciated.

    Read the article

  • Dependency injection in C++

    - by Yorgos Pagles
    This is also a question that I asked in a comment in one of Miško Hevery's google talks that was dealing with dependency injection but it got buried in the comments. I wonder how can the factory / builder step of wiring the dependencies together can work in C++. I.e. we have a class A that depends on B. The builder will allocate B in the heap, pass a pointer to B in A's constructor while also allocating in the heap and return a pointer to A. Who cleans up afterwards? Is it good to let the builder clean up after it's done? It seems to be the correct method since in the talk it says that the builder should setup objects that are expected to have the same lifetime or at least the dependencies have longer lifetime (I also have a question on that). What I mean in code: class builder { public: builder() : m_ClassA(NULL),m_ClassB(NULL) { } ~builder() { if (m_ClassB) { delete m_ClassB; } if (m_ClassA) { delete m_ClassA; } } ClassA *build() { m_ClassB = new class B; m_ClassA = new class A(m_ClassB); return m_ClassA; } }; Now if there is a dependency that is expected to last longer than the lifetime of the object we are injecting it into (say ClassC is that dependency) I understand that we should change the build method to something like: ClassA *builder::build(ClassC *classC) { m_ClassB = new class B; m_ClassA = new class A(m_ClassB, classC); return m_ClassA; } What is your preferred approach?

    Read the article

  • MVVM application architecture, where to put dependency injection configuration class, BusinessLayer and Common interfaces?

    - by gt.guybrush
    Planning my architecture for an MVVM application I come to this: MyApp.UI View MyApp.BusinessLayer ViewModel MyApp.DataAccessLayer RepositoryImplEF MyApp.DomainLayer DomainObject RepositoryInterface MyApp.Common Logging Security Utility (contains some reflection method used by many levels) CustomException MyApp.UnitTest I was inspired by Domain-driven-desing, test-driven-development and onion architecture but not sure to have done all well. I am not sure of a couple of things: where to put dependency injection configuration class? In the common project? where to put BusinessLayer interfaces? in Domain layer? where to put Common interfaces? in Domain layer? But Common in referenced from domain (for some reflection utilities and for DI if the response to 1. is yes) and circular reference isn't good

    Read the article

  • Software center is broken

    - by Colin
    When I started installing the Humble Indie Bundle 5 games the software center stopped working and now I get this error. Packages cannot be installed or removed, click here to repair. Which fails and gives these results. installArchives() failed: (Reading database ... (Reading database ... 5% (Reading database ... 10% (Reading database ... 15% (Reading database ... 20% (Reading database ... 25% (Reading database ... 30% (Reading database ... 35% (Reading database ... 40% (Reading database ... 45% (Reading database ... 50% (Reading database ... 55% (Reading database ... 60% (Reading database ... 65% (Reading database ... 70% (Reading database ... 75% (Reading database ... 80% (Reading database ... 85% (Reading database ... 90% (Reading database ... 95% (Reading database ... 100% (Reading database ... 255502 files and directories currently installed.) Unpacking libqtcore4:i386 (from .../libqtcore4_4%3a4.8.1-0ubuntu4.1_i386.deb) ... dpkg: error processing /var/cache/apt/archives/libqtcore4_4%3a4.8.1-0ubuntu4.1_i386.deb (--unpack): conffile './etc/xdg/Trolltech.conf' is not in sync with other instances of the same package No apport report written because MaxReports is reached already Errors were encountered while processing: /var/cache/apt/archives/libqtcore4_4%3a4.8.1-0ubuntu4.1_i386.deb Error in function: dpkg: dependency problems prevent configuration of libqtgui4:i386: libqtgui4:i386 depends on libqtcore4 (= 4:4.8.1-0ubuntu4.1); however: Package libqtcore4:i386 is not installed. dpkg: error processing libqtgui4:i386 (--configure): dependency problems - leaving unconfigured dpkg: dependency problems prevent configuration of libqt4-sql:i386: libqt4-sql:i386 depends on libqtcore4 (= 4:4.8.1-0ubuntu4.1); however: Package libqtcore4:i386 is not installed. dpkg: error processing libqt4-sql:i386 (--configure): dependency problems - leaving unconfigured dpkg: dependency problems prevent configuration of ia32-libs-multiarch:i386: ia32-libs-multiarch:i386 depends on libqt4-sql; however: Package libqt4-sql:i386 is not configured yet. ia32-libs-multiarch:i386 depends on libqtcore4; however: Package libqtcore4:i386 is not installed. ia32-libs-multiarch:i386 depends on libqtgui4; however: Package libqtgui4:i386 is not configured yet. dpkg: error processing ia32-libs-multiarch:i386 (--configure): dependency problems - leaving unconfigured dpkg: dependency problems prevent configuration of libqt4-declarative:i386: libqt4-declarative:i386 depends on libqt4-sql (= 4:4.8.1-0ubuntu4.1); however: Package libqt4-sql:i386 is not configured yet. libqt4-declarative:i386 depends on libqtcore4 (= 4:4.8.1-0ubuntu4.1); however: Package libqtcore4:i386 is not installed. libqt4-declarative:i386 depends on libqtgui4 (= 4:4.8.1-0ubuntu4.1); however: Package libqtgui4:i386 is not configured yet. dpkg: error processing libqt4-declarative:i386 (--configure): dependency problems - leaving unconfigured dpkg: dependency problems prevent configuration of libqt4-svg:i386: libqt4-svg:i386 depends on libqtcore4 (= 4:4.8.1-0ubuntu4.1); however: Package libqtcore4:i386 is not installed. libqt4-svg:i386 depends on libqtgui4 (= 4:4.8.1-0ubuntu4.1); however: Package libqtgui4:i386 is not configured yet. dpkg: error processing libqt4-svg:i386 (--configure): dependency problems - leaving unconfigured dpkg: dependency problems prevent configuration of libqt4-network:i386: libqt4-network:i386 depends on libqtcore4 (= 4:4.8.1-0ubuntu4.1); however: Package libqtcore4:i386 is not installed. dpkg: error processing libqt4-network:i386 (--configure): dependency problems - leaving unconfigured dpkg: dependency problems prevent configuration of libqt4-sql-mysql:i386: libqt4-sql-mysql:i386 depends on libqt4-sql (= 4:4.8.1-0ubuntu4.1); however: Package libqt4-sql:i386 is not configured yet. libqt4-sql-mysql:i386 depends on libqtcore4 (= 4:4.8.1-0ubuntu4.1); however: Package libqtcore4:i386 is not installed. dpkg: error processing libqt4-sql-mysql:i386 (--configure): dependency problems - leaving unconfigured dpkg: dependency problems prevent configuration of libqt4-script:i386: libqt4-script:i386 depends on libqtcore4 (= 4:4.8.1-0ubuntu4.1); however: Package libqtcore4:i386 is not installed. dpkg: error processing libqt4-script:i386 (--configure): dependency problems - leaving unconfigured dpkg: dependency problems prevent configuration of libqt4-dbus:i386: libqt4-dbus:i386 depends on libqtcore4 (= 4:4.8.1-0ubuntu4.1); however: Package libqtcore4:i386 is not installed. dpkg: error processing libqt4-dbus:i386 (--configure): dependency problems - leaving unconfigured dpkg: dependency problems prevent configuration of libqt4-opengl:i386: libqt4-opengl:i386 depends on libqtcore4 (= 4:4.8.1-0ubuntu4.1); however: Package libqtcore4:i386 is not installed. libqt4-opengl:i386 depends on libqtgui4 (= 4:4.8.1-0ubuntu4.1); however: Package libqtgui4:i386 is not configured yet. dpkg: error processing libqt4-opengl:i386 (--configure): dependency problems - leaving unconfigured dpkg: dependency problems prevent configuration of libqtwebkit4:i386: libqtwebkit4:i386 depends on libqt4-network (>= 4:4.8.0~); however: Package libqt4-network:i386 is not configured yet. libqtwebkit4:i386 depends on libqtcore4 (>= 4:4.8.0~); however: Package libqtcore4:i386 is not installed. libqtwebkit4:i386 depends on libqtgui4 (>= 4:4.8.0); however: Package libqtgui4:i386 is not configured yet. dpkg: error processing libqtwebkit4:i386 (--configure): dependency problems - leaving unconfigured dpkg: dependency problems prevent configuration of libqt4-designer:i386: libqt4-designer:i386 depends on libqt4-script (= 4:4.8.1-0ubuntu4.1); however: Package libqt4-script:i386 is not configured yet. libqt4-designer:i386 depends on libqtcore4 (= 4:4.8.1-0ubuntu4.1); however: Package libqtcore4:i386 is not installed. libqt4-designer:i386 depends on libqtgui4 (= 4:4.8.1-0ubuntu4.1); however: Package libqtgui4:i386 is not configured yet. dpkg: error processing libqt4-designer:i386 (--configure): dependency problems - leaving unconfigured dpkg: dependency problems prevent configuration of lonesurvivor-bin:i386: lonesurvivor-bin:i386 depends on ia32-libs-multiarch; however: Package ia32-libs-multiarch:i386 is not configured yet. dpkg: error processing lonesurvivor-bin:i386 (--configure): dependency problems - leaving unconfigured dpkg: dependency problems prevent configuration of lonesurvivor: lonesurvivor depends on lonesurvivor-bin (= 1.11d-0ubuntu5); however: Package lonesurvivor-bin is not installed. Package lonesurvivor-bin:i386 is not configured yet. dpkg: error processing lonesurvivor (--configure): dependency problems - leaving unconfigured dpkg: dependency problems prevent configuration of libqt4-scripttools:i386: libqt4-scripttools:i386 depends on libqt4-script (= 4:4.8.1-0ubuntu4.1); however: Package libqt4-script:i386 is not configured yet. libqt4-scripttools:i386 depends on libqtcore4 (= 4:4.8.1-0ubuntu4.1); however: Package libqtcore4:i386 is not installed. libqt4-scripttools:i386 depends on libqtgui4 (= 4:4.8.1-0ubuntu4.1); however: Package libqtgui4:i386 is not configured yet. dpkg: error processing libqt4-scripttools:i386 (--configure): dependency problems - leaving unconfigured dpkg: dependency problems prevent configuration of libqt4-qt3support:i386: libqt4-qt3support:i386 depends on libqt4-designer (= 4:4.8.1-0ubuntu4.1); however: Package libqt4-designer:i386 is not configured yet. libqt4-qt3support:i386 depends on libqt4-network (= 4:4.8.1-0ubuntu4.1); however: Package libqt4-network:i386 is not configured yet. libqt4-qt3support:i386 depends on libqt4-sql (= 4:4.8.1-0ubuntu4.1); however: Package libqt4-sql:i386 is not configured yet. libqt4-qt3support:i386 depends on libqtcore4 (= 4:4.8.1-0ubuntu4.1); however: Package libqtcore4:i386 is not installed. libqt4-qt3support:i386 depends on libqtgui4 (= 4:4.8.1-0ubuntu4.1); however: Package libqtgui4:i386 is not configured yet. dpkg: error processing libqt4-qt3support:i386 (--configure): dependency problems - leaving unconfigured dpkg: dependency problems prevent configuration of libqt4-xml:i386: libqt4-xml:i386 depends on libqtcore4 (= 4:4.8.1-0ubuntu4.1); however: Package libqtcore4:i386 is not installed. dpkg: error processing libqt4-xml:i386 (--configure): dependency problems - leaving unconfigured dpkg: dependency problems prevent configuration of libqt4-test:i386: libqt4-test:i386 depends on libqtcore4 (= 4:4.8.1-0ubuntu4.1); however: Package libqtcore4:i386 is not installed. dpkg: error processing libqt4-test:i386 (--configure): dependency problems - leaving unconfigured dpkg: dependency problems prevent configuration of libqt4-xmlpatterns:i386: libqt4-xmlpatterns:i386 depends on libqt4-network (= 4:4.8.1-0ubuntu4.1); however: Package libqt4-network:i386 is not configured yet. libqt4-xmlpatterns:i386 depends on libqtcore4 (= 4:4.8.1-0ubuntu4.1); however: Package libqtcore4:i386 is not installed. dpkg: error processing libqt4-xmlpatterns:i386 (--configure): dependency problems - leaving unconfigured I couldn't get the apt-get update or upgrade to work either so I shut off the repositories and updated / upgraded one at a time without any problems. But that didn't fix the Software Center. Help would be greatly appreciated. ADDED UPDATE I've tried to install aptitude using dpkg but can't. I have also tried sudo apt-get dist-upgrade sudo apt-get autoremove sudo dpkg --configure -a --force-all and the -f options. Though I believe this is where my problem is originating: Reading package lists... Done Building dependency tree Reading state information... Done Correcting dependencies... Done The following extra packages will be installed: libqtcore4:i386 The following NEW packages will be installed: libqtcore4:i386 0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded. Need to get 0 B/2,061 kB of archives. After this operation, 9,041 kB of additional disk space will be used. Do you want to continue [Y/n]? y (Reading database ... 255526 files and directories currently installed.) Unpacking libqtcore4:i386 (from .../libqtcore4_4%3a4.8.1-0ubuntu4.1_i386.deb) ... dpkg: error processing /var/cache/apt/archives/libqtcore4_4%3a4.8.1-0ubuntu4.1_i386.deb (--unpack): conffile './etc/xdg/Trolltech.conf' is not in sync with other instances of the same package Errors were encountered while processing: /var/cache/apt/archives/libqtcore4_4%3a4.8.1-0ubuntu4.1_i386.deb E: Sub-process /usr/bin/dpkg returned an error code (1) I hope this helps narrow it down some. SECOND UPDATE sudo apt-get --reinstall install software-center -f The following packages have unmet dependencies: ia32-libs-multiarch:i386 : Depends: libqtcore4:i386 but it is not going to be installed libqt4-dbus:i386 : Depends: libqtcore4:i386 (= 4:4.8.1-0ubuntu4.1) but it is not going to be installed libqt4-declarative:i386 : Depends: libqtcore4:i386 (= 4:4.8.1-0ubuntu4.1) but it is not going to be installed libqt4-designer:i386 : Depends: libqtcore4:i386 (= 4:4.8.1-0ubuntu4.1) but it is not going to be installed libqt4-network:i386 : Depends: libqtcore4:i386 (= 4:4.8.1-0ubuntu4.1) but it is not going to be installed libqt4-opengl:i386 : Depends: libqtcore4:i386 (= 4:4.8.1-0ubuntu4.1) but it is not going to be installed libqt4-qt3support:i386 : Depends: libqtcore4:i386 (= 4:4.8.1-0ubuntu4.1) but it is not going to be installed libqt4-script:i386 : Depends: libqtcore4:i386 (= 4:4.8.1-0ubuntu4.1) but it is not going to be installed libqt4-scripttools:i386 : Depends: libqtcore4:i386 (= 4:4.8.1-0ubuntu4.1) but it is not going to be installed libqt4-sql:i386 : Depends: libqtcore4:i386 (= 4:4.8.1-0ubuntu4.1) but it is not going to be installed libqt4-sql-mysql:i386 : Depends: libqtcore4:i386 (= 4:4.8.1-0ubuntu4.1) but it is not going to be installed libqt4-svg:i386 : Depends: libqtcore4:i386 (= 4:4.8.1-0ubuntu4.1) but it is not going to be installed libqt4-test:i386 : Depends: libqtcore4:i386 (= 4:4.8.1-0ubuntu4.1) but it is not going to be installed libqt4-xml:i386 : Depends: libqtcore4:i386 (= 4:4.8.1-0ubuntu4.1) but it is not going to be installed libqt4-xmlpatterns:i386 : Depends: libqtcore4:i386 (= 4:4.8.1-0ubuntu4.1) but it is not going to be installed libqtgui4:i386 : Depends: libqtcore4:i386 (= 4:4.8.1-0ubuntu4.1) but it is not going to be installed libqtwebkit4:i386 : Depends: libqtcore4:i386 (>= 4:4.8.0~) but it is not going to be installed E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution). sudo apt-get -f install doesn't work either. Complete output of terminal for step 5 can be found here, http://paste.ubuntu.com/1066192/

    Read the article

  • Dependency Injection Constructor Madness

    - by JP
    I find that my constructors are starting to look like this: public MyClass(Container con, SomeClass1 obj1, SomeClass2, obj2.... ) with ever increasing parameter list. Since "Container" is my dependency injection container, why can't I just do this: public MyClass(Container con) for every class? What are the downsides? If I do this, it feels like I'm using a glorified static. Please share your thoughts on IoC and Dependency Injection madness. Thanks in advance. -JP

    Read the article

  • Dependency Injection book recommendation(s)

    - by Portman
    It seems like there are very few books (yes, I read books) on Dependency Injection. The Amazon tag for "dependency injection" lists only a few titles, and all of them are specifically about Spring for Java. Are there any books out there that cover DI/IoC in general? Or any that include a survey of multiple DI frameworks? Or any that cover .NET in lieu of or in addition to Java? Or do we have to rely on this newfangled interweb instead of dead trees...

    Read the article

  • How to use Dependency Injection with ASP.NET

    - by Schneider
    I am trying to work out a way to use Dependency Injection with ASP.NET controls. I have got lots of controls that create repositories directly, and use those to access and bind to data etc. I am looking for a pattern where I can pass repositories to the controls externally (IoC), so my controls remain unaware of how repositories are constructed and where they come from etc. I would prefer not to have a dependency on the IoC container from my controls, therefore I just want to be able to construct the controls with constructor or property injection. (And just to complicate things, these controls are being constructed and placed on the page by a CMS at runtime!) Any thoughts?

    Read the article

  • Spring constructor injection of SLF4J logger - how to get injection target class?

    - by disown
    I'm trying to use Spring to inject a SLF4J logger into a class like so: @Component public class Example { private final Logger logger; @Autowired public Example(final Logger logger) { this.logger = logger; } } I've found the FactoryBean class, which I've implemented. But the problem is that I cannot get any information about the injection target: public class LoggingFactoryBean implements FactoryBean<Logger> { @Override public Class<?> getObjectType() { return Logger.class; } @Override public boolean isSingleton() { return false; } @Override public Logger getObject() throws Exception { return LoggerFactory.getLogger(/* how do I get a hold of the target class (Example.class) here? */); } } Is FactoryBean even the right way to go? When using picocontainers factory injection, you get the Type of the target passed in. In guice it is a bit trickier. But how do you accomplish this in Spring?

    Read the article

  • Is dependency injection possible for JSP beans?

    - by kazanaki
    This may be a long shot question.. I am working on an application that is based on JSP/Javascript only (without a Web framework!) Is there a way to have depencency injection for JSP beans? By jsp beans I mean beans defined like this <jsp:useBean id="cart" scope="session" class="session.Carts" /> Is there a way/library/hack to intercept the bean creation so that when "cart" is referenced for the first time, some some of injection takes place? Can I define somewhere a "listener" for JSP beans (like you can do for JSF beans for example)? I am free to do anything I want in the back-end, but I cannot add a web framework in the front-end (Don't ask!)

    Read the article

  • How to model dependency injection in UML ?

    - by hjo1620
    I have a Contract class. The contract is valid 1 Jan 2010 - 31 Dec 2010. It can be in state Active or Passive, depending on which date I ask the instance for it's state. ex. if I ask 4 July 2010, it's in state Active, but if I ask 1 Jan 2011, it's in state Passive. Instances are created using constructor dependency injection, i.e. they are either Active or Passive already when created, null is not allowed as a parameter for the internal state member. One initial/created vertex is drawn in UML. I have two arrows, leading out from the initial vertex, one leading to state Active and the other to state Passive. Is this a correct representation of dependency injection in UML ? This is related to http://stackoverflow.com/questions/2779922/how-model-statemachine-when-state-is-dependent-on-a-function which initiated the question on how to model DI in general, in UML.

    Read the article

  • Dependency Injection & Singleton Design pattern

    - by SysAdmin
    How do we identify when to use dependency injection or singleton pattern. I have read in lot of websites where they say "Use Dependency injection over singleton pattern". But I am not sure if I totally agree with them. For my small or medium scale projects I definitely see the use of singleton pattern straightforward. For example Logger. I could use Logger.GetInstance().Log(...) But, instead of this, why do I need to inject every class I create, with the logger's instance?.

    Read the article

  • How exactly does dependency injection reduce coupling?

    - by dotnetdev
    Hi, I've done plenty of reading on Dependency Injection, but I have no idea, how does it actually reduce coupling? The analogy I have of DI is that all components are registered with a container, so theyre are like in a treasure chest. To get a component, you obviously register it first, but then you would have to interrogate the treasure chest (which is like a layer of indirection). Is this the right analogy? It doesn't make obvious how the "injection" happens, though (how would that fit in with this analogy?). Thanks

    Read the article

  • PHP Security checklist (injection, sessions etc)

    - by NoviceCoding
    So what kind of things should a person using PHP and MySql be focused on to maximize security. Things I have done: -mysql_real_escape_string all inputs -validate all inputs after escaping em -Placed random alpha numerics before my table names -50character salt + Ripemd passwords Heres where I think I am slacking: -I know know nothing about sessions and securing them. How unsafe/safe is it if all you are doing is: session_start(); $_SESSION['login']= $login; and checking it with: session_start(); if(isset($_SESSION['login'])){ -I heard something about other forms of injection like cross site injection and what not... -And probably many other things I dont know about. Is there a "checklist"/Quicktut on making php secure? I dont even know what I should be worried about.I kinda regret now not building off cakephp since I am not a pro.

    Read the article

  • Problem with UserControl with custom Dependency Property

    - by Mathias Koch
    Hi, I'm writing a user control with a dependency property for a search text called SearchText. It is a dependency property because I want to allow consumers of the control to use data binding. The user control contains a WPF TextBox where the user can enter the search text. I could use data binding to connect the SearchText dependency property of the user control with the Text dependency property of the TextBox, but this binding only fires when the text box looses input focus. What I want is SearchText to be updated after every change of Text. So I have added a TextChanged event handler to the user control where I set SearchText to the value of Text. My Problem is, the SearchText binding doesn't work, the source never gets updated. What am I doing wrong? Here's the relevant part of the user controls code-behind: public partial class UserControlSearchTextBox : UserControl { public string SearchText { get { return (string)GetValue(SearchTextProperty); } set { SetValue(SearchTextProperty, value); } } public static readonly DependencyProperty SearchTextProperty = DependencyProperty.Register("SearchText", typeof(string), typeof(UserControlSearchTextBox), new UIPropertyMetadata("")); private void TextBox_TextChanged(object sender, TextChangedEventArgs e) { SearchText = ((TextBox)sender).Text; } ... } The window that contains an instance of the user control has its DataContext set to an object that has a property also called SearchText. <uc:UserControlSearchTextBox SearchText="{Binding SearchText}" /> The data context of the Window: public class DataSourceUserManual : DataSourceBase { private string _searchText; public string SearchText { get { return _searchText; } set { _searchText = value; ... OnPropertyChanged("SearchText"); } } } Unfortunately, this setter is not called when I type into the text box. Any ideas?

    Read the article

  • SQL Injection - some sense at last!

    - by TATWORTH
    I see various articles that proclaim means to guard against SQL injection. As individual steps they are of use but since they were often proclaimed as "the solution" they were potentially misleading. At http://www.simple-talk.com/sql/learn-sql-server/sql-injection-defense-in-depth/ there is an article entitled "SQL Injection: Defense in Depth" - this article argues what I have argued myself. Remember that however low-grade the information on your web site is, if your site is hacked, the public may percive the hacking as your most sensitive information was exposed.

    Read the article

  • SQL Injection Attacks are still occurring

    - by TATWORTH
    It should be of concern to all developers that SQL Injection attacks are still occurring. Here are some resources on the subject: http://www.darkreading.com/DatabaseSecurity/util/4576/download.html (needs free registration) http://en.wikipedia.org/wiki/SQL_injection http://www.unixwiz.net/techtips/sql-injection.html http://msdn.microsoft.com/en-us/library/ms161953.aspx http://www.sitepoint.com/sql-injection-attacks-safe/ And for a funny view on it see http://xkcd.com/327/ So what are you doing to harden your applications?

    Read the article

  • Contexts and Dependency Injection(CDI)??

    - by Masa Sasaki
    WebLogic Server?????????????WebLogic Server????????6?20?????????37?WebLogic Server???@????????Contexts and Dependency Injection(CDI)?(?????????? Fusion Middleware?????? ?? ?)?????????????????Java EE 6????????CDI???????DI(Dependency Injection)?Java EE 5????????????????????CDI??DI????????????????????????????????????????????????????????CDI????????????????????(?????? Fusion Middleware?????? ??? ??) CDI?? ???????CDI???Java EE 6???????JSR299: Contexts Dependency Injection????? ?????Dependency Injection (??????)?Aspect-Oriented Programming (AOP)?Interception ??????????????????????????? CDI?????????????????????????????????????????????? ?????????????????????????????????????????? ?????????????????????????????????????????????? ???????????????????????????CDI?????????????? CDI?????????????2? ??1???CDI??????????Oracle WebLogic Server 12c????Java EE 6????????? ?????????????????2???beans.xml???????Web??????????WEB-INF/beans.xml? EJB??META-INF/beans.xml????????????CDI????????????????beans.xml???? ?????????????????????? Java EE 5?DI(Dependency Injection) Java EE 5??DI????????????????????????????????????? ?????????????????????????????????????????(@EJB? @Resource?@WebServiceRef)??? Java EE 6?CDI Java EE 6?CDI?????????????????@Inject???????????????? ???????????????????????????????????????????????????? @Qualifier????????????????? ?????????????????????????????????????????@Qualifier? ????????????·??????????????????????@JPN??????????? @Produce???????? ???????????????????? ????????·?????????????? CDI?????????????????????????????????·??????? ????????????????????????????????????????????? ???????????????? EL(Expression Language) ???????? EL????????????JSF?ManagedBean?????????????·?????????????? ??? Java EE 6?????????CDI???????????Java EE 5?DI????AOP??? ???????????????????DI, AOP???????????????? ?????????????CDI?????????????????????????????? ?????CDI?????????????????????????????????? ?????? WebLogic Server??? WebLogic Server?????????WebLogic Server?????! WebLogic Server??????(???????????) WebLogic Server???????? WebLogic Server??????

    Read the article

  • Binding a dependency property to another dependency property

    - by Rire1979
    Take this scenario where I am working with a grid like control: <RadGrid DataContext={Binding someDataContextObject, Mode=OneWay}> <RadGrid.columns> <RadGrid.Column Header="Column Header" DataMember="{Binding dataContextObjectProperty, Mode=OneWay}"> [...] <DataTemplate> <MyCustomControl Data="{Binding ???}" /> </DataTemplate> <\RadGrid.Column> </RadGrid.columns> </RadGrid> I would like to bind the Data dependency property of MyCustomControl to the DataMember dependency property of the column to avoid multiple bindings to the same data. How do I do it?

    Read the article

  • Dependency Injection: where to store dependencies used by only one method?

    - by simoneL
    I developing a project integrated with Dependency Injection (just for reference, I'm using Unity). The problem is that I have some Manager classes with several methods and in many cases I have dependencies used only in one method. public class UserManager : IUserManager { private UserRepository UserRepository {get;set;} private TeamRepository TeamRepository {get;set;} private CacheRepository CacheRepository {get;set;} private WorkgroupRepository WorkgroupRepository {get;set;} public UserManager(UserRepository userRepository, TeamRepository teamRepository, CacheRepository cacheRepository , WorkgroupRepository workgroupRepository, ... // Many other dependencies ) { UserRepository = userRepository; TeamRepository = teamRepository; CacheRepository = cacheRepository ; WorkgroupRepository = workgroupRepository; ... // Setting the remaining dependencies } public void GetLatestUser(){ // Uses only UserRepository } public void GetUsersByTeam(int teamID){ // Uses only TeamRepository } public void GetUserHistory(){ // Uses only CacheRepository } public void GetUsersByWorkgroup(int workgroupID){ // Uses only workgroupRepository } } The UserManager is instantiated in this way: DependencyFactory<IUserManager>(); Note: DependencyFactory is just a wrapper to simplify the access to the UnityContainer Is it OK to have classes like that in the example? Is there a better way to implement avoiding to instantiate all the unnecessary dependencies?

    Read the article

  • Rhino Mocks, Dependency Injection, and Separation of Concerns

    - by whatispunk
    I am new to mocking and dependency injection and need some guidance. My application is using a typical N-Tier architecture where the BLL references the DAL, and the UI references the BLL but not the DAL. Pretty straight forward. Lets say, for example, I have the following classes: class MyDataAccess : IMyDataAccess {} class MyBusinessLogic {} Each exists in a separate assembly. I want to mock MyDataAccess in the tests for MyBusinessLogic. So I added a constructor to the MyBusinessLogic class to take an IMyDataAccess parameter for the dependency injection. But now when I try to create an instance of MyBusinessLogic on the UI layer it requires a reference to the DAL. I thought I could define a default constructor on MyBusinessLogic to set a default IMyDataAccess implementation, but not only does this seem like a codesmell it didn't actually solve the problem. I'd still have a public constructor with IMyDataAccess in the signature. So the UI layer still requires a reference to the DAL in order to compile. One possible solution I am toying with is to create an internal constructor for MyBusinessLogic with the IMyDataAccess parameter. Then I can use an Accessor from the test project to call the constructor. But there's still that smell. What is the common solution here. I must just be doing something wrong. How could I improve the architecture?

    Read the article

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