application-design

Spring and Guice together, or just Spring

纵然是瞬间 提交于 2019-11-30 08:25:34
I'm starting a new Java web app from scratch. I don't have much experience on Spring Framework, but I know I'd like to use some of its features, such as Transaccions Management. On the other hand, I really like Guice for dependency injection. I know that Guice and Spring can work together: http://www.jroller.com/mindcrime/entry/an_example_of_integrating_guice But before starting designing my application, I wanted to know if someone had experienced issues by following that approach. Also, what I really like from Guice is that you don't need an XML configuration file, but just java Modules,

Writing a Snow Leopard Service for Finder.app

烂漫一生 提交于 2019-11-30 02:28:17
I am currently looking into solving the problem with the inability to quickly create new files in the Finder. I will open source what I write because I think the Mac community needs this solved. On Windows, you can right-click, create new text file. OS X, you should be able to do this with a service which would work like this: Right-Click > Services > Create New Text File Writing a Finder Service in Snow Leopard is theoretically the way to accomplish this, although I haven't been able to find any sample code. (I'll admit I've only looked at the documentation very briefly). I'm not sure how to

Spring and Guice together, or just Spring

久未见 提交于 2019-11-29 11:06:17
问题 I'm starting a new Java web app from scratch. I don't have much experience on Spring Framework, but I know I'd like to use some of its features, such as Transaccions Management. On the other hand, I really like Guice for dependency injection. I know that Guice and Spring can work together: http://www.jroller.com/mindcrime/entry/an_example_of_integrating_guice But before starting designing my application, I wanted to know if someone had experienced issues by following that approach. Also, what

Is DTO pattern deprecated or not?

会有一股神秘感。 提交于 2019-11-29 03:53:55
In a complete Java EE application that's clustered is the DTO pattern still a valid option? The application in question uses EJBs Hibernate and Struts with Spring etc. Is there anything wrong with transferring domain objects in such a scenario? EDIT: Just to clarify my question, with modern day resources and improvements in Java EE is there a reason not to just use domain objects? If there is not then isn't DTO pattern sort of fading out and shouldn't be used in new applications? Luiggi Mendoza Is not deprecated. It depends on the application architecture if the DTO pattern should be used or

should the user's Account balance be stored in the database or calculated dynamically?

帅比萌擦擦* 提交于 2019-11-28 23:44:22
Should the user's Account balance be stored in the database or calculated dynamically? For accurate results calculating it dynamically make sense but then it might be a problem, when there are many user's and the database grows very large? Transaction Id (PK) AccountId Type DateTime Amount etc..etc... AccountBalance TransactionId (PK/FK) BalanceAmount In order to keep accurate auditing you should make record of every transaction that affects the users account balance. This means you can calculate the balance dynamically, however for performance reasons I would have the balance stored as well.

Hibernate lazy-load application design

谁都会走 提交于 2019-11-28 15:02:17
I tend to use Hibernate in combination with Spring framework and it's declarative transaction demarcation capabilities (e.g., @Transactional ). As we all known, hibernate tries to be as non-invasive and as transparent as possible, however this proves a bit more challenging when employing lazy-loaded relationships. I see a number of design alternatives with different levels of transparency. Make relationships not lazy-loaded (e.g., fetchType=FetchType.EAGER) This vioalites the entire idea of lazy loading .. Initialize collections using Hibernate.initialize(proxyObj); This implies relatively

Is DTO pattern deprecated or not?

一曲冷凌霜 提交于 2019-11-27 17:52:44
问题 In a complete Java EE application that's clustered is the DTO pattern still a valid option? The application in question uses EJBs Hibernate and Struts with Spring etc. Is there anything wrong with transferring domain objects in such a scenario? EDIT: Just to clarify my question, with modern day resources and improvements in Java EE is there a reason not to just use domain objects? If there is not then isn't DTO pattern sort of fading out and shouldn't be used in new applications? 回答1: Is not

should the user's Account balance be stored in the database or calculated dynamically?

為{幸葍}努か 提交于 2019-11-27 15:00:38
问题 Should the user's Account balance be stored in the database or calculated dynamically? For accurate results calculating it dynamically make sense but then it might be a problem, when there are many user's and the database grows very large? Transaction Id (PK) AccountId Type DateTime Amount etc..etc... AccountBalance TransactionId (PK/FK) BalanceAmount 回答1: In order to keep accurate auditing you should make record of every transaction that affects the users account balance. This means you can

What is the best “forgot my password” method? [duplicate]

感情迁移 提交于 2019-11-27 10:19:44
Possible Duplicate: Forgot Password: what is the best method of implementing a forgot password function? I'm programming a community website. I want to build a "forgot my password" feature. Looking around at different sites, I've found they employ one of three options : send the user an email with a link to a unique, hidden URL that allows him to change his password (Gmail and Amazon) send the user an email with a new, randomly generated password (Wordpress) send the user his current password (www.teach12.com) Option #3 seems the most convenient to the user but since I save passwords as an MD5

Is Using .NET 4.0 Tuples in my C# Code a Poor Design Decision?

不打扰是莪最后的温柔 提交于 2019-11-27 10:12:59
With the addition of the Tuple class in .net 4, I have been trying to decide if using them in my design is a bad choice or not. The way I see it, a Tuple can be a shortcut to writing a result class (I am sure there are other uses too). So this: public class ResultType { public string StringValue { get; set; } public int IntValue { get; set; } } public ResultType GetAClassedValue() { //..Do Some Stuff ResultType result = new ResultType { StringValue = "A String", IntValue = 2 }; return result; } Is equivalent to this: public Tuple<string, int> GetATupledValue() { //...Do Some stuff Tuple<string