Search Results

Search found 9771 results on 391 pages for 'equivalence classes'.

Page 28/391 | < Previous Page | 24 25 26 27 28 29 30 31 32 33 34 35  | Next Page >

  • Class.Class vs Namespace.Class for top level general use class libraries?

    - by Joan Venge
    Which one is more acceptable (best-practice)?: namespace NP public static class IO public static class Xml ... // extension methods using NP; IO.GetAvailableResources (); vs public static class NP public static class IO public static class Xml ... // extension methods NP.IO.GetAvailableResources (); Also for #2, the code size is managed by having partial classes so each nested class can be in a separate file, same for extension methods (except that there is no nested class for them) I prefer #2, for a couple of reasons like being able to use type names that are already commonly used, like IO, that I don't want to replace or collide. Which one do you prefer? Any pros and cons for each? What's the best practice for this case? EDIT: Also would there be a performance difference between the two?

    Read the article

  • AS3 Passing data between objects/classes

    - by 1337holiday
    So i a building a categorized menu of different foods. I have a class for "categories" (buttons) which essentially will return a string "salads", "drinks", etc. I now have another class "menuItems" for items within categories and this handles sizes such as "small", "med", "large", etc. My problem now is that when i return "salads", i want to invoke an array which contains all the elements of salads, send it to menuItems which will populate the menu. So far i have both the category objects and the menu object setup. I just cant seem to be able to send the data that the category object is returning and pass it to the menu object. Both of which are added to the stage as shown below: If there was a way that i could say add all these classes to one class so that they can talk to each other that would be great but i dont know how to do this. Been stuck for hours, please any help is greatly appreciated.

    Read the article

  • C++ enforce conditions on inherited classes

    - by user231536
    I would like to define an abstract base class X and enforce the following: a) every concrete class Y that inherits from X define a constructor Y(int x) b) it should be possible to test whether two Y objects are equal. For a, one not very good solution is to put a pure virtual fromInt method in X which concrete class will have to define. But I cannot enforce construction. For b), I cannot seem to use a pure virtual method in X bool operator == (const X& other) const =0; because in overridden classes this remains undefined. It is not enough to define bool operator == (const Y& other) const { //stuff} because the types don't match. How do I solve these problems?

    Read the article

  • Define classes for a datatable structure - ORM

    - by user424493
    I have existing tables - I have following datatables : ActivityTable(Key ActivityId) - which lists the identifier for various activity ProcessTable (identified by ProcessId) - which lists down which activites(ActivityId) are to be carried out along with their order(StepNum). Some of the activities are marked constant with in a process, that is they will have same data, ir-respective of there run environment. RunTable(Key RunConfigurationId) - that identifies the project name and Process Id Then data for each activity is stored is stored in their individual tables Activity_A, Activity_B,Activity_C so on it uses a combination of RunConfigurationId,ProcessId and stepNum. For the activities which are constant we use a RunConfigurationId= -100. Can anybody help me out how I can map something like this in classes using inheritence regards

    Read the article

  • Create object of unknown class (two inherited classes)

    - by Paul
    I've got the following classes: class A { void commonFunction() = 0; } class Aa: public A { //Some stuff... } class Ab: public A { //Some stuff... } Depending on user input I want to create an object of either Aa or Ab. My imidiate thought was this: A object; if (/*Test*/) { Aa object; } else { Ab object; } But the compiler gives me: error: cannot declare variable ‘object’ to be of abstract type ‘A’ because the following virtual functions are pure within ‘A’: //The functions... Is there a good way to solve this?

    Read the article

  • creating events in my classes, and allowing others to hook into them in my django app

    - by Blankman
    I want to create events for my classes. Say I create a CMS application that has a Article object. I create events like: OnEdit OnCreate OnDelete PreCreate PreDelete Now I want someone to be able to hook into these events, and add their custom functionality at each event they wish. I don't want them touching the core source code, so they would have to wire these custom methods to fire somewhere else. I'm new to both python and django so please be as detailed as possible if you can.

    Read the article

  • Does the following indicate a bad design?

    - by Mewzer
    Hello, I was wondering whether you think the following code usually indicates a bad design ... class X { public: ... private: Y y; }; Class Y { public: Y( X& value ){ x = value; }; private: X& x; } (i.e. there is some sort of cyclic dependency between the classes X and Y).

    Read the article

  • Design classes/interface to support methods returning different types

    - by Nayn
    Hi, I have classes as below. public interface ITest <T> { public T MethodHere(); } public class test1 implements ITest<String> { String MethodHere(){ return "Bla"; } } public class test2 implements ITest<Integer> { Integer MethodHere(){ return Integer.valueOf(2); } } public class ITestFactory { public static ITest getInstance(int type) { if(type == 1) return new test1(); else if(type == 2) return new test2(); } } There is a warning in the factory class that ITest is used as raw type. What modification should I do to get rid of it? Thanks Nayn

    Read the article

  • PyQt4.QtCore doesn't contain many of its classes and attributes

    - by toc777
    Hi everyone, I have built PyQt4 from source and everything went smoothly until I tried to use some of the classes and attributes located in QtCore. For some reason QtCore is missing a lot of functionality and data that should be there. For example from PyQt4.QtCore import QT_VERSION_STR is an import error. There were no errors or warnings given when building the packages and I have also tried with the PyQt packages from yum but I have the same problem. Has anyone else encountered this problem before? Thanks.

    Read the article

  • Difference between the Document classes

    - by takoi
    I've been reading the javadocs trying to grasp around the swing Document API but I cant get something sensible out of it because there's so many classes: Document, StyledDocument, AbstractDocument, DefaultStyledDocument, PlainDocument, HTMLDocument, and someone mentioned DocumentFilter. This question is more on a general basis so can someone give an overview of the differences between the implementations and when the different interfaces and abstracts are for? For my specific case what I want to achieve is a data structure that will: hold three lines of text only. And attributes must not be per line or document. I will have a couple of thousand of these in some other structure so overhead is important. Anything that i can use for this or is it better to extend something? If so, what?

    Read the article

  • Problem with non-copyable classes

    - by DeadMG
    I've got some non-copyable classes. I don't invoke any of the copy operators or constructor, and this code compiles fine. But then I upgraded to Visual Studio 2010 Ultimate instead of Professional. Now the compiler is calling the copy constructor- even when the move constructor should be invoked. For example, in the following snippet: inline D3D9Mesh CreateSphere(D3D9Render& render, float radius, float slices) { D3D9Mesh retval(render); /* ... */ return std::move(retval); } Error: Cannot create copy constructor, because the class is non-copyable. However, I quite explicitly moved it.

    Read the article

  • Destructors for C++ Interface-like classes

    - by sdg
    Starting to use PC-Lint on an existing code base (fear and trepidation). One thing that it complains about is the following: class IBatch { public: virtual void StartBatch() =0; virtual int CommitBatch() =0; }; Which when another class derives from this to use it like an interface base class 'IBatch' has no destructor So, the question: when you create Interface classes like the above, do you always include a virtual destructor? Why? (is it a style or a coding error?)

    Read the article

  • Override existing AS3 classes

    - by purga
    For a custom derived class "Vector2" from flash.geom.Point, when trying to override the clone() method (similar to add(), subtract() methods that will return the type itself), it will always complain about incompatible overriding 'cuz the return type has been altered from "Point" to "Vector2". import flash.geom.Point; public class Vector2 extends Point { //Constructor is good public function Vector2(x:Number = 0, y:Number = 0) { super(x,y); } // Error: Incompatible overriding override public function clone():Vector2 //return type has to be "Point" { return new Vector2(this.x , this.y); } } How can we correctly reuse/override the methods provided by the super classes as supposed to create our own one (e.g. : a new clone1() method), or simply we just can't? Thanks.

    Read the article

  • Having access to a private variable from other classes in Java

    - by Crystal
    If I want to create a form that adds people to a List, how do I have access to that List from another class? Where would I define that List so other classes can access the members, the size, etc? For example, if I have Class Foo that has the GUI for my form, along with buttons to add and remove people to the List, it would make sense to me to declare the List as a private instance variable of Class Foo. But then if I have another class, Class Bar, how does it get the values that are currently in that List to update some other graphical components? Or is that the wrong place to declare the List in general? Thanks.

    Read the article

  • How to convert a void pointer to array of classes

    - by user99545
    I am trying to convert a void pointer to an array of classes in a callback function that only supports a void pointer as a means of passing paramaters to the callback. class person { std::string name, age; }; void callback (void *val) { for (int i = 0; i < 9; i++) { std::cout << (person [])val[i].name; } } int main() { person p[10]; callback((void*)p); } My goal is to be able to pass an array of the class person to the callback which then prints out the data such as their name and age. However, the compile does not like what I am doing and complains that error: request for member 'name' in 'val', which is of non-class type 'void*' How can I go about doing this?

    Read the article

  • Simple C++ classes question

    - by Without me Its just Aweso
    Its been a long time since i've done C++ and I'm running into some trouble with classes referencing eachother. right now I have something like: a.h class a { public: a(); bool skeletonfunc(b temp); } ==================== b.h class b { public: b(); bool skeletonfunc(a temp); } since each one needs a reference to the other i've found I cant do a #include of eachother at the top or i end up in a weird loop of sorts with the includes. So how can I make it so that a can use b and vice versa with out making a cyclical #include problem. thanks!

    Read the article

  • How to get suggestions in NetBeans for included files

    - by Flexx
    i have a problem to get suggestions for classes which are included in included files. E.g. content of file 'Header.php' is: //File 'Header.php': include('User.php'); //Class file When I now include the Header.php in my file 'Example.php', i do not get any suggestions: //File 'Example.php': include('Header.php'); User:: After typing User:: I exspect Methods and Vars of class User as suggestions, but there arent any. If I would include 'User.php' directly in my 'Example.php' it works, but that doesn't help me. How to solve this problem?

    Read the article

  • php calling classes functions in separate pages

    - by sys_debug
    I've worked with J2EE recently and like the idea of struts.xml where I can handle the redirection to pages based on return string from action classes. In PHP, in my new under-development site, I am trying to follow the MVC standards without an MVC framework used from the internet. So I create the controllers, models and views (empty now). The only thing I am really stuck at is when I submit the form in view (insert_product.php) then I will need to create another php page to handle the post data and pass them to controllers. Anyway of avoiding creating those pages and maybe having something like struts.xml? Even if I can post data directly to controller class, that would be good. Thanks,

    Read the article

  • Member classes versus #includes

    - by ShallowThoughts
    I've recently discovered that it is bad form to have #includes in your header files because anyone who uses your code gets all those extra includes they won't necessarily want. However, for classes that have member variables defined as a type of another class, what's the alternative? For example, I was doing things the following way for the longest time: /* Header file for class myGrades */ #include <vector> //bad #include "classResult.h" //bad class myGrades { vector<classResult> grades; int average; int bestScore; } (Please excuse the fact that this is a highly artificial example) So, if I want to get rid of the #include lines, is there any way I can keep the vector or do I have to approach programming my code in an entirely different way?

    Read the article

  • javax.validation.ConstraintViolationException: validation failed for classes during update time for groups

    - by Tim
    Hello all! I have a Java / Spring MVC 3 application, using Hibernate and a MySQL database. In my controller, I have this source code: Set<ConstraintViolation<Person>> failures = validator.validate(p); if (failures.isEmpty()) { Project project = this.projectService.findProjectById(projectid); Person newPerson = this.personService.addPerson(p); Set<Person> persons = this.personService.getAllPersonsByProjectId(projectid); persons.add(newPerson); project.setPersons(persons); Set<ConstraintViolation<Project>> failures1 = validator.validate(project); if (!failures1.isEmpty()) { System.out.println("ERROR"); } else { System.out.println("NO ERROR"); } this.projectService.updateProject(project); return Collections.singletonMap("person", newPerson); } Project and Person are a many-to-many relation annotated with @manytomany and Project is the mapping owner. The new Person is added, but on the line with this.projectService.updateProject(project); I get an error. What it does it this in a Dao Hibernate implementation: public void updateProject(Project p) { SessionFactory sessionFactory = HibernateUtil.getSessionFactory(); Session sess = sessionFactory.getCurrentSession(); Transaction tx = sess.beginTransaction(); sess.update(p); tx.commit(); } It failed on the line tx.commit();. My check with if (!failures1.isEmpty()) { tell me that there are nor errors in my project. So what's wrong here? And why there is a validation of my project? I did not call a validation method... so why is there a org.hibernate.cfg.beanvalidation.BeanValidationEventListener.validate()? I hope, someone can help me how to fix this! Best Regards, Tim. Here the full error stack trace: 13.01.2011 00:06:36 org.apache.catalina.core.ApplicationDispatcher invoke SERVE: Servlet.service() for servlet project3 threw exception javax.validation.ConstraintViolationException: validation failed for classes [com.mydomain.myproject.domain.Person] during update time for groups [javax.validation.groups.Default, ] at org.hibernate.cfg.beanvalidation.BeanValidationEventListener.validate(BeanValidationEventListener.java:155) at org.hibernate.cfg.beanvalidation.BeanValidationEventListener.onPreUpdate(BeanValidationEventListener.java:102) at org.hibernate.action.EntityUpdateAction.preUpdate(EntityUpdateAction.java:235) at org.hibernate.action.EntityUpdateAction.execute(EntityUpdateAction.java:86) at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:273) at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:265) at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:185) at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:321) at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:51) at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1216) at org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:383) at org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:133) at com.mydomain.myproject.dao.impl.ProjectDaoImplHibernate.updateProject(ProjectDaoImplHibernate.java:44) at com.mydomain.myproject.service.impl.ProjectServiceImpl.updateProject(ProjectServiceImpl.java:39) at com.mydomain.myproject.controller.ProjectPersonController.addPerson(ProjectPersonController.java:189) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.springframework.web.bind.annotation.support.HandlerMethodInvoker.invokeHandlerMethod(HandlerMethodInvoker.java:176) at org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.invokeHandlerMethod(AnnotationMethodHandlerAdapter.java:426) at org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.handle(AnnotationMethodHandlerAdapter.java:414) at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:790) at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:719) at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:644) at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:560) at javax.servlet.http.HttpServlet.service(HttpServlet.java:637) at javax.servlet.http.HttpServlet.service(HttpServlet.java:717) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:646) at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:436) at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:374) at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:302) at org.tuckey.web.filters.urlrewrite.NormalRewrittenUrl.doRewrite(NormalRewrittenUrl.java:195) at org.tuckey.web.filters.urlrewrite.RuleChain.handleRewrite(RuleChain.java:159) at org.tuckey.web.filters.urlrewrite.RuleChain.doRules(RuleChain.java:141) at org.tuckey.web.filters.urlrewrite.UrlRewriter.processRequest(UrlRewriter.java:90) at org.tuckey.web.filters.urlrewrite.UrlRewriteFilter.doFilter(UrlRewriteFilter.java:417) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:857) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588) at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489) at java.lang.Thread.run(Thread.java:619) 13.01.2011 00:06:36 org.apache.catalina.core.StandardWrapperValve invoke SERVE: Servlet.service() for servlet default threw exception javax.validation.ConstraintViolationException: validation failed for classes [com.mydomain.myproject.domain.Person] during update time for groups [javax.validation.groups.Default, ] at org.hibernate.cfg.beanvalidation.BeanValidationEventListener.validate(BeanValidationEventListener.java:155) at org.hibernate.cfg.beanvalidation.BeanValidationEventListener.onPreUpdate(BeanValidationEventListener.java:102) at org.hibernate.action.EntityUpdateAction.preUpdate(EntityUpdateAction.java:235) at org.hibernate.action.EntityUpdateAction.execute(EntityUpdateAction.java:86) at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:273) at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:265) at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:185) at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:321) at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:51) at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1216) at org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:383) at org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:133) at com.mydomain.myproject.dao.impl.ProjectDaoImplHibernate.updateProject(ProjectDaoImplHibernate.java:44) at com.mydomain.myproject.service.impl.ProjectServiceImpl.updateProject(ProjectServiceImpl.java:39) at com.mydomain.myproject.controller.ProjectPersonController.addPerson(ProjectPersonController.java:189) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.springframework.web.bind.annotation.support.HandlerMethodInvoker.invokeHandlerMethod(HandlerMethodInvoker.java:176) at org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.invokeHandlerMethod(AnnotationMethodHandlerAdapter.java:426) at org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.handle(AnnotationMethodHandlerAdapter.java:414) at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:790) at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:719) at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:644) at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:560) at javax.servlet.http.HttpServlet.service(HttpServlet.java:637) at javax.servlet.http.HttpServlet.service(HttpServlet.java:717) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:646) at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:436) at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:374) at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:302) at org.tuckey.web.filters.urlrewrite.NormalRewrittenUrl.doRewrite(NormalRewrittenUrl.java:195) at org.tuckey.web.filters.urlrewrite.RuleChain.handleRewrite(RuleChain.java:159) at org.tuckey.web.filters.urlrewrite.RuleChain.doRules(RuleChain.java:141) at org.tuckey.web.filters.urlrewrite.UrlRewriter.processRequest(UrlRewriter.java:90) at org.tuckey.web.filters.urlrewrite.UrlRewriteFilter.doFilter(UrlRewriteFilter.java:417) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:857) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588) at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489) at java.lang.Thread.run(Thread.java:619) UPDATE Before updating the Project where the error occurs, I add a person which have this annotated: @NotNull @Size(min = 1, max = 255) @Pattern(regexp="(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|\"(?:[\\x01-\\x08\\x0b\\x0c\\x0e-\\x1f\\x21\\x23-\\x5b\\x5d-\\x7f]|\\\\[\\x01-\\x09\\x0b\\x0c\\x0e-\\x7f])*\")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[\\x01-\\x08\\x0b\\x0c\\x0e-\\x1f\\x21-\\x5a\\x53-\\x7f]|\\\\[\\x01-\\x09\\x0b\\x0c\\x0e-\\x7f])+)\\])", message="{my.email.error.message}") private String email; Without the @Pattern no error... So, what's wrong here? UPDATE-2: I use Hibernate 3.6.0.Final and I have these in my Maven pom.xml: <!-- JSR 303 with Hibernate Validator --> <dependency> <groupId>javax.validation</groupId> <artifactId>validation-api</artifactId> <version>1.0.0.GA</version> </dependency> <dependency> <groupId>org.hibernate</groupId> <artifactId>hibernate-validator</artifactId> <version>4.1.0.Final</version> </dependency>

    Read the article

  • When to use abstract classes instead of interfaces and extension methods in C#?

    - by Gulshan
    "Abstract class" and "interface" are similar type of ideas, while interface being more abstract. One need of abstract classes was to provide method implementations for the derived classes. But in C#, that need has also been reduced by lately introduced extension methods. So, in C#, when should we use abstract classes instead of using interfaces and extension methods associated with the interface? And now, we can use 'Properties' in interfaces also. A notable example of interface+ extension methods is the Heavily used IEnumerable and it's helper methods. You use Linq and it's all by this extension methods!

    Read the article

  • When to use abstract classes instead of interfaces and extension methods in C#?

    - by Gulshan
    "Abstract class" and "interface" are similar type of ideas, while interface being more abstract. One need of abstract classes was to provide method implementations for the derived classes. But in C#, that need has also been reduced by lately introduced extension methods. So, in C#, when should we use abstract classes instead of using interfaces and extension methods associated with the interface? And now, we can use 'Properties' in interfaces also. A notable example of interface+ extension methods is the Heavily used IEnumerable and it's helper methods. You use Linq and it's all by this extension methods!

    Read the article

  • How to import ejb project classes into web project on eclipse?

    - by Jhonnytunes
    I have 3 projects on eclipse, maven ejb project, maven wicket webapp project and a enterprise application project that includes ejb and web I mentioned before, as modules. But my question is, How from my web project can I use classes on the ejb project. Lets say ClassA is on the ejb project and I want to say from web project: ClassA cl = new ClassA. I wont be allowed since web project doesnt have ClassA but ejb project. I want to use ejb project as a Business Logic, JPA part. Also I want to include here some not beans classes that I want to use from the web. Dont know if its possible. The web project goes without Business logic, just the wicket pages calling ejb, and using ther classes. Im new in the EE world. Never made an ear file including a war and ejb jar for deploying it on Glassfish. Thanks in advanced.

    Read the article

  • How do I know when should I package my classes in Ruby?

    - by Omega
    In Ruby, I'm creating a small game development framework. Just some personal project - a very small group of friends helping. Now I am in need of handling geometric concepts. Rectangles, Circles, Polygons, Vectors, Lines, etc. So I made a class for each of these. I'm stuck deciding whether I should package such classes in a module, such as Geometry. So I'd access them like Geometry::Rectangle, or just Rectangle if I include the module. Now then, my question isn't about this specific scenario. I'd like to know, when is it suitable to package similar classes into one module in Ruby? What factors should I consider? Amount of classes? Usage frequency? Complexity?

    Read the article

  • Is having 'Util' classes a cause for concern? [closed]

    - by Matt Fenwick
    I sometimes create 'Util' classes which primarily serve to hold methods and values that don't really seem to belong elsewhere. But every time I create one of these classes, I think "uh-oh, I'm gonna regret this later ...", because I read somewhere that it's bad. But on the other hand, there seem to be two compelling (at least for me) cases for them: implementation secrets that are used in multiple classes within a package providing useful functionality to augment a class, without cluttering its interface Am I on the way to destruction? What you say !! Should I refactor?

    Read the article

< Previous Page | 24 25 26 27 28 29 30 31 32 33 34 35  | Next Page >