@Repository annotation should be used to indicate those classes that compose the DAO layer.
@Service annotation can be used to designate those classes that are part of an application's service facade, which are used in the web layer to handle requests
@Controller annotation denotes the presence of a POJO that should be used for Spring MVC interactions. Defines a service facade.
jueves, 20 de diciembre de 2012
jueves, 13 de diciembre de 2012
Spring - Load properties
(application-context.xml)
In your application-context.xml, use the tag context:property-placeholder to define the property file where you have the values of your bean properties.
The value of location is the rath of your file:
<context:property-placeholder location="classpath*:spring/*.properties" />
In case that you have your property file outside your project:
<context:property-placeholder location=""file:///var/conf/conf.properties"/>
After define your file properties with the values:
db.name = test
db.user = user
db.password = password
db.port = 3306
Finally you can use the properties in your beans:
<bean id="dataSource"
class="org.springframework.jdbc.datasource.DriverManagerDataSource">
<property name="driverClassName" value="com.mysql.jdbc.Driver" />
<property name="url" value="jdbc:mysql://localhost:3306/test" />
<property name="username" value= "${db.user}" />
<property name="password" value="${db.password}" />
</bean>
(web.xml)
In the web.xml don´t forget to include the file application-context.xml
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>
/WEB-INF/application-context.xml
</param-value>
</context-param>
In your application-context.xml, use the tag context:property-placeholder to define the property file where you have the values of your bean properties.
The value of location is the rath of your file:
<context:property-placeholder location="classpath*:spring/*.properties" />
In case that you have your property file outside your project:
<context:property-placeholder location=""file:///var/conf/conf.properties"/>
After define your file properties with the values:
db.name = test
db.user = user
db.password = password
db.port = 3306
Finally you can use the properties in your beans:
<bean id="dataSource"
class="org.springframework.jdbc.datasource.DriverManagerDataSource">
<property name="driverClassName" value="com.mysql.jdbc.Driver" />
<property name="url" value="jdbc:mysql://localhost:3306/test" />
<property name="username" value= "${db.user}" />
<property name="password" value="${db.password}" />
</bean>
(web.xml)
In the web.xml don´t forget to include the file application-context.xml
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>
/WEB-INF/application-context.xml
</param-value>
</context-param>
Java Project Structure
In Eclipse to add the structure folders choose New -> Soure Folder
Select the chech box "Update exclusion filters into other source folders to solve nesting"
- Within the project_name folder, we'll create the folders that are customary for a Java application:
project_name/src project_name/src/main project_name/src/main/java project_name/src/main/resources
- For web applications, we need a webapp and WEB-INF folder:
project_name/src/main/webapp project_name/src/main/webapp/WEB-INF
- We also need to create the folders that are required for unit testing our application:
project_name/src/test project_name/src/test/java project_name/src/test/resources
- And finally, we'll create the two folders where Spring configuration files are ordinarily placed:
project_name/src/main/webapp/WEB-INF/spring
miércoles, 21 de noviembre de 2012
How to read?
All the time we have new information and no time to learn everything so what I did was to learn how to read faster.
What I learned was the next points previous to the lecture:
What I learned was the next points previous to the lecture:
- About the material
- Where comes the information?
- How many time I need to spend?
- What is the relationship with me (job, hobbies)??
- Is the material appropiate?
- What I want to read?
- Why I chose this material?
- What kind of information Am I expecting?
- Do I need to read everything?
- What the purpouse of the new information?
- The new information Would increase my knowledge?
- Previous to read
- What I am expecting to learn?
- Would it satisfied my initials expectations ?
- Would it be easy or difficult the lecture?
- Before read
- Your expectations were justified?
- Did you accomplish your expectations?
- Did you get a benefit, like save time or arise your knowledge?
- If you read the material for first time, would you change something?
domingo, 4 de noviembre de 2012
Drools First Step
For this example use Eclipse Juno, Drools 5.4.0
- Install in Eclipse the drools plug-in
- Help -> Install new Software
- Typer in "Work with" http://download.jboss.org/drools/release/5.4.0.Final/org.drools.updatesite/. That change according with the last version
- Click Add
- Type in "type filter text", Drools
- Select the chechbox
- Click Finish
- Create the Drools Workspace
- File -> Properties
- Type "Drools"
- In the window left side -> Configure workspace setting -> Add
- Select from the uncompressed zip the folder \binaries, in my case "drools-distribution-5.4.0.Final\binaries"
- Click Ok to accept the changes
- Create a Drools Project to verify
- File -> New Project -> type "Drools"
- Create a Java class to invoke the rules
- Implement KnowledgeBuilder to parse the DRL files
- Implement KnowledgeBase to compare the object Vs rules
- Insert some object to evaluate the rules
viernes, 2 de noviembre de 2012
Project First Steps
Develop a project managment plan
I write this as result of taking one Project course and the main points are:
- Establish the project duration
- Calendar configuration
- Before start writing the activities configure the calendars to manage the tiem that each team member is going to be have in the project
- Configure the labors hours and hollidays
- Option: Project -> Change work time -> Create calendar To manage globally the calendars and share between different projects
- Option: File->Information->Calendars->
- Activity duration is different to the duration of the labor day
- Activities
- Define the block of activities
- Select Format -> Schema number, to list the activities
- Relation between activities
- Finish to Start
- Finish to Finish
- Start to Start
- Start to Finish
- Define Automatic or Manual dependency between activities
- Always work with tasks of the same level
- Milestone
- Used to define a point of control
- Define dependency between milestones
- Constraints
- All the activities has to be programed as automatic, if not the type of constrains are unavailable.
- Deadline.- Before type a deadline will appear a green arrow pointing the date
- Constraints
- As late as possible
- As soon as possible
- Finish no earlier than
- Finish no later than
- Must finish on
- Must start on
- Start no earlier than
- Start no later than
- Date constraints
- Resources
- Use View -> Details
- Formula Work = Duration * Resources (Unit)
martes, 30 de octubre de 2012
The Focus Solution
The idea of this philosophy is just be focus on the solutions as goal, following the next steps:
- Solutions, not problems
- Detect what is working
- Take in mind what you want
- What do you want to accomplish today?
- Will you be aware if you've made progress?
- What works for you generally?
- Solution talk
- Inbetween-the action is in the interaction
- Do small changes
- Make use of what's there
- The solution is in front of you
- Everything is a useful thing
- Use of counters
- Possibilities - Past, Present, Future
- Past - There is a past victory or triumph.
- Using a scale where 10 is perfect and 1 is nothing, where are you?? Then describe how you get from the 1 to 2, then from 3 to 4, etc until achieve the perfect future.
- Present - Focus and use the things that are working fine, develop a positive trend
- Future - Create the perfect future, how the perfect future is
- Language
- Keep the language simple
- Every case is different
- There isn't a general solution
- Optimistic and pessimism
Suscribirse a:
Entradas (Atom)