Search Results

Search found 15 results on 1 pages for 'zenzen'.

Page 1/1 | 1 

  • Should we test all our methods?

    - by Zenzen
    So today I had a talk with my teammate about unit testing. The whole thing started when he asked me "hey, where are the tests for that class, I see only one?". The whole class was a manager (or a service if you prefer to call it like that) and almost all the methods were simply delegating stuff to a DAO so it was similar to: SomeClass getSomething(parameters) { return myDao.findSomethingBySomething(parameters); } A kind of boilerplate with no logic (or at least I do not consider such simple delegation as logic) but a useful boilerplate in most cases (layer separation etc.). And we had a rather lengthy discussion whether or not I should unit test it (I think that it is worth mentioning that I did fully unit test the DAO). His main arguments being that it was not TDD (obviously) and that someone might want to see the test to check what this method does (I do not know how it could be more obvious) or that in the future someone might want to change the implementation and add new (or more like "any") logic to it (in which case I guess someone should simply test that logic). This made me think, though. Should we strive for the highest test coverage %? Or is it simply an art for art's sake then? I simply do not see any reason behind testing things like: getters and setters (unless they actually have some logic in them) "boilerplate" code Obviously a test for such a method (with mocks) would take me less than a minute but I guess that is still time wasted and a millisecond longer for every CI. Are there any rational/not "flammable" reasons to why one should test every single (or as many as he can) line of code?

    Read the article

  • Eclipse vs Netbeans Web Service Tooling

    - by Zenzen
    Some time ago (~4-5months ago) I attented a lecture about JEE and at some point the lecturer started talking about webservices and how hard it is to create a good one because all the IDEs make them in a bit different way (or something like that) and that in general it's better to use Netbeans to create them as Eclipse has some issues, the thing is he didn't really say why Eclipse is bad. Now I'm wondering is what he said true and why, is it really better to use Netbeans for webservices and why?

    Read the article

  • [OffTopic] PhD is it worth it?

    - by Zenzen
    So I'll be graduating next year (hopefully) and lately I started thinking about getting a PhD in computer science (to be more precise I was thinking about something related to "distributed systems", don't have any specific topics yet in mind), but is it really worth it? A PhD course here lasts 4 years and is free IF you're doing the "normal one" (which means you have class from monday to friday) OR you have to pay if you want to study on the weekends. So I've been thinking about getting a normal full time job (as a JEE programmer) and doing my PhD during the weekends OR doing the normal PhD course (mon-fri) and getting a part time job as a software dev (the main reason I want a job is simple - I need to eat). That would give me practical working experience and theoretical knowledge+a PhD, but it would also mean working 7days a week from 9 to 5 for 4 years straight (sounds like an overkill). Is it, job wise, really worth getting a PhD? As an employer do you prefer people with PhDs or MScs? This might be kinda important - I'm not from the US or western europe, how are PhDs from other countries (I am graduating one of the best, if not the best, school in my country but it's still a central european country...) seen? Are they useless? I won't hide it - after graduation I am thinking about moving abroad.

    Read the article

  • Getting Facebook email/email hash.

    - by Zenzen
    I'll make it short: is it possible to get the user's facebook email adress (or a hashed email adress), so I can let's say compare his facebook email with his email in my database? I'm trying to get a FacebookUser and then use facebookUser.email_hash but that returns nothing.

    Read the article

  • Flex+JPA/Hibernate+BlazeDS+MySQL how to debug this monster?!

    - by Zenzen
    Ok so I'm making a "simple" web app using the technologies from the topic, recently I found http://www.adobe.com/devnet/flex/articles/flex_hibernate.html so I'm following it and I try to apply it to my app, the only difference being I'm working on a Mac and I'm using MAMP for the database (so no command line for me). The thing is I'm having some trouble with retrieving/connecting to the database. I have the remoting-config.xml, persistance.xml, a News.java class (my Entity), a NewsService.java class, a News.as class - all just like in the tutorial. I have of course this line in one of my .mxmls: <mx:RemoteObject id="loaderService" destination="newsService" result="handleLoadResult(event)" fault="handleFault(event)" showBusyCursor="true" /> And my remoting-config.xml looks like this (well part of it): <destination id="newsService"> <properties><source>com.gamelist.news.NewsService</source></properties> </destination> NewsService has a method: public List<News> getLatestNews() { EntityManagerFactory emf = Persistence.createEntityManagerFactory(PERSISTENCE_UNIT); EntityManager em = emf.createEntityManager(); Query findLatestQuery = em.createNamedQuery("news.findLatest"); List<News> news = findLatestQuery.getResultList(); return news; } And the named query is in the News class: @Entity @Table(name="GLT_NEWS") @NamedQueries({ @NamedQuery(name="news.findLatest", query="from GLT_NEWS order by new_date_added limit 5 ") }) The handledLoadResult looks like this: private function handleLoadResult(ev:ResultEvent):void { newsList = ev.result as ArrayCollection; newsRecords = newsList.length; } Where: [Bindable] private var newsList:ArrayCollection = new ArrayCollection(); But when I try to trigger: loaderService.getLatestNews(); nothing happens, newsList is empty. Few things I need to point out: 1) as I said I didn't install mysql manually, but I'm using MAMP (yes, the server's running), could this cause some trouble? 2) I already have a "gladm" database and I have a "GLT_NEWS" table with all the fields, is this bad? Basically the question is how am I suppose to debug this thing so I can find the mistake I'm making? I know that loadData() is executed (did a trace()), but I have no idea what happens with loaderService.getLatestNews()... @EDIT: ok so I see I'm getting an error in the "fault handler" which says "Error: Client.Error.MessageSend - Channel.Connect.Failed error NetConnection.Call.Failed: HTTP: Status 404: url: 'http://localhost:8080/WebContent/messagebroker/amf' - "

    Read the article

  • How to prepare for a Java test?

    - by Zenzen
    Ok so in two days I have a test for my dream job (well it's an internship, but still!) and for quite some time now I've been reading the SCJP Guide book in order to prepare myself. BUT seeing how slow my reading speed is I guess finding a website with some "java essentials" or "standard java test questions" and going through it in those 2 days would be a better idea. Don't misunderstand me, I do have java experience and it's "only" an internship, but we all know how programming tests look like and how tricky they can be. So are there any online resources you could recommend me? I know 2 days is not much, but well I was informed bout the test 1-2days ago.

    Read the article

  • JPopupMenu returning a null?

    - by Zenzen
    Ok so I'm working on an Eclipse plugin based on the JGraph example. The problem is I can't really get the "save" method to work, here's how the program works in short: - I have a DiagramEditor class with an init() method, where I create a GraphEditor object and call the createFrame() methord of that object. - GraphEditor extends the BasicGraphEditor (which extends JPanel), the createFrame() method returns a JFrame and has a line "frame.setJMenuBar(menuBar)" - the "menuBar" is an object variable, which is initialized in the BasicGraphEditor. Till here everything is cool, the problem is with the action listener which is supposed to save a file. To get the graph I need to get the GraphEditor component, so I do a Component component = (Component) e.getSource() whitch is the ActionEvent passed to that action listener and at that stage is the JMenuItem "save", then I get the parent which is the JPopupMenu, then I want to get that JPopupMenu's parent which should be the GraphEdiotor, but instead I get a null. Any idea why? Here's some source code: DiagramEditor.java: @Override public void init(IEditorSite site, IEditorInput input) throws PartInitException { setSite(site); setInput(input); this.diagram = ((DiagramEditorInput)input).getDiagram(); setPartName(this.diagram.getName()); gEditor = new GraphEditor(); gEditor.createFrame().setVisible(true); } BasicGraphEditor.java: public JFrame createFrame() { JFrame frame = new JFrame(); frame.getContentPane().add(this); frame.setJMenuBar(menuBar); //frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.setSize(870, 640); return frame; } In the constructor: menuBar = new JMenuBar(); menu = new JMenu("File"); menu.setMnemonic(KeyEvent.VK_F); menuBar.add(menu); JMenuItem openMenuItem = new JMenuItem("Open", KeyEvent.VK_O); // ADD FILE OPENING //openMenuItem.addActionListener(menuListener); menu.add(openMenuItem); JMenuItem saveMenuItem = new JMenuItem("Save", new ImageIcon("/images/save.gif")); saveMenuItem.setMnemonic(KeyEvent.VK_S); saveMenuItem.addActionListener( new SaveAction(false) ); menu.add(saveMenuItem); // menu.add(new SaveAction(false)); JMenuItem saveMenuItemAs = new JMenuItem("SaveAs", new ImageIcon("/images/saveas.gif")); //saveMenuItemAs.setMnemonic(KeyEvent.VK_S); saveMenuItemAs.addActionListener( new SaveAction(true) ); menu.add(saveMenuItemAs); //menu.add(new SaveAction(true)); JMenuItem closeMenuItem = new JMenuItem("Close", KeyEvent.VK_C); closeMenuItem.addActionListener( new ActionListener() { public void actionPerformed(ActionEvent e) { System.exit(0); } } ); menu.add(closeMenuItem);

    Read the article

  • How to learn flex?

    - by Zenzen
    So I'm starting an internship as a Flex developer in ~2weeks thanks to a friend of mine. The thing is I know squat about Flex - it is an internship after all so I'm supposed to learn there, but nonetheless I want to have some basic understanding of Flex before I start (eventually I want to become a JEE/Flex dev). So my question is simple, which book(s) would you recommend me to start with? Are there any "must have" books, like let's say "Thinking in C++" for C++ etc.? I already heard about a few video tutorials and I will surely check them out but I'd also want to get some decent books.

    Read the article

  • JPopupMenu getParent() returning a null?

    - by Zenzen
    Ok so I'm working on an Eclipse plugin based on the JGraph example. The problem is I can't really get the "save" method to work, here's how the program works in short: - I have a DiagramEditor class with an init() method, where I create a GraphEditor object and call the createFrame() methord of that object. - GraphEditor extends the BasicGraphEditor (which extends JPanel), the createFrame() method returns a JFrame and has a line "frame.setJMenuBar(menuBar)" - the "menuBar" is an object variable, which is initialized in the BasicGraphEditor. Till here everything is cool, the problem is with the action listener which is supposed to save a file. To get the graph I need to get the GraphEditor component, so I do a Component component = (Component) e.getSource() whitch is the ActionEvent passed to that action listener and at that stage is the JMenuItem "save", then I get the parent which is the JPopupMenu, then I want to get that JPopupMenu's parent which should be the GraphEdiotor, but instead I get a null. Any idea why? Here's some source code: DiagramEditor.java: @Override public void init(IEditorSite site, IEditorInput input) throws PartInitException { setSite(site); setInput(input); this.diagram = ((DiagramEditorInput)input).getDiagram(); setPartName(this.diagram.getName()); gEditor = new GraphEditor(); gEditor.createFrame().setVisible(true); } BasicGraphEditor.java: public JFrame createFrame() { JFrame frame = new JFrame(); frame.getContentPane().add(this); frame.setJMenuBar(menuBar); //frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.setSize(870, 640); return frame; } In the constructor: menuBar = new JMenuBar(); menu = new JMenu("File"); menu.setMnemonic(KeyEvent.VK_F); menuBar.add(menu); JMenuItem openMenuItem = new JMenuItem("Open", KeyEvent.VK_O); // ADD FILE OPENING //openMenuItem.addActionListener(menuListener); menu.add(openMenuItem); JMenuItem saveMenuItem = new JMenuItem("Save", new ImageIcon("/images/save.gif")); saveMenuItem.setMnemonic(KeyEvent.VK_S); saveMenuItem.addActionListener( new SaveAction(false) ); menu.add(saveMenuItem); // menu.add(new SaveAction(false)); JMenuItem saveMenuItemAs = new JMenuItem("SaveAs", new ImageIcon("/images/saveas.gif")); //saveMenuItemAs.setMnemonic(KeyEvent.VK_S); saveMenuItemAs.addActionListener( new SaveAction(true) ); menu.add(saveMenuItemAs); //menu.add(new SaveAction(true)); JMenuItem closeMenuItem = new JMenuItem("Close", KeyEvent.VK_C); closeMenuItem.addActionListener( new ActionListener() { public void actionPerformed(ActionEvent e) { System.exit(0); } } ); menu.add(closeMenuItem);

    Read the article

  • How to motivate as a project leader?

    - by Zenzen
    Ok so some of you might think this is not stackoverflow related, but since I got a similar question during an interview (for a J2EE dev position) I think you guys will help me in the end. The situation is simple: you're working on a project in a small group (4-5 people), you're the project leader and the guy who's the most competent (technology wise) is also slacking the most. What do you do to motivate him? The problem is, I'm having the same issue at the university - this semester we have a lot of projects going on (6 to be exact) so we decided to dived the work so everyone will do 1-2 projects in a technology he knows/wants to learn. It's been working well for the most part, the problem is the person whom we thought would finish his project way before us as he's the most experienced among us. How am I supposed to make him do his share properly? Till now he was just half assing his part by doing the bare minimum, with which the professor wasn't really pleased to say the least... Now it's only a university project, but in the future I might have the same problem in a real job and losing a really smart and experienced worker (as firing him is the only solution I can come up with now) would really be a waste. Aren't there any better ways? p.s. now that I think about it, are there any books that would help me in becoming a better project manager?

    Read the article

  • Spring/EJB 3 books?

    - by Zenzen
    Ok so I'm a complete beginner when it comes to Spring and EJB and I really want to change it, the problem is I can't find any single book on Spring 3/EJB 3, everything is about 2 (for Spring/EJB) or 2.5 (for Spring). What are the differences between 2.x and 3? Should I just go with the 2.x books and then google the differences? I was thinking about getting Pro Spring 2.5 from Apress and Head First EJB (huge fan, ut from what I've heard it is rather out of date), or are there better positions?

    Read the article

  • Eclipse vs Netbeans

    - by Zenzen
    Some time ago (~4-5months ago) I attented a lecture about JEE and at some point the lecturer started talking about webservices and how hard it is to create a good one because all the IDEs make them in a bit different way (or something like that) and that in general it's better to use Netbeans to create them as Eclipse has some issues, the thing is he didn't really say why Eclipse is bad. Now I'm wondering is what he said true and why, is it really better to use Netbeans for webservices and why?

    Read the article

  • [OT a bit] Flex+JEE what is it good for?

    - by Zenzen
    Ok so sorry for being, I guess, a bit off topic but still I think this is the best place to ask. My new semester just started (don't worry I won't ask you to do my homework) and this time we have a rather cool subject about www programming in general where we have to do a web service, web abb - whatever as long as it's "web". Here's the problem though, my team and I want to do it with Flex and JEE but we don't have much experience about what are they actually used for. I mean we know you can do virtually anything with it, but we don't really want to lose time on doing something useless. My first idea was to do a "brainstorming" 3D room/service - a place where people could log in have a video conference, a whiteboard, a place to upload pictures everyone could see, some toolbars for google, youtube etc. plus some other features which would make real-time brainstorming easy when you can't get everyone in one place. But is Flex+JEE really suitable? I mean I'm 99% sure it's doable but is it really worth doing it in Flex+JEE or was the whole purpose of JEE completely different? @EDIT: well this was only one of our ideas obviously. I do know the basics of JSP, Servlets, JPA etc. of course but yeah the main goal of this project is to get some actual experience. The problem is we don't really know is it worth doing something like let's say a social network (something like extended facebook) for gamers (doesn't really matter if it already exists) in JEE or would it only look ridiculous (because PHP or whatever would be a far better choice)? Bottom line is that we are wondering are only large scale applications (for banks etc.) written in JEE or is it good for anything (even the smaller projects)?

    Read the article

  • Unique serial number in a java web application.

    - by Zenzen
    I've been wondering what's the correct practice for generating unique ids? The thing is in my web app I'll have a plugin system, when a user registers a plugin I want to generate a unique serial ID for it. I've been thinking about storing all numbers in a DB or a file on the server, generating a random number and checking whether it already exists in the DB/file, but that doesn't seem that good. Are there other ways to do it? Would using the UUID be the preferred way to go?

    Read the article

  • Annotations: methods vs variables

    - by Zenzen
    I was always sure (don't know why) that it's better to add annotations to variables, but while browsing the Hibernate doc http://docs.jboss.org/hibernate/stable/annotations/reference/en/html_single/#entity-hibspec-collection I noticed they tend to annotate the methods. So should I put my annotations before methods, like this: @Entity public class Flight implements Serializable { private long id; @Id @GeneratedValue public long getId() { return id; } public void setId(long id) { this.id = id; } } Or is it better to do it like this: @Entity public class Flight implements Serializable { @Id @GeneratedValue private long id; public long getId() { return id; } public void setId(long id) { this.id = id; } } Or maybe there's no difference?

    Read the article

1