Automapper for Java [closed] - java

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
Is there Java equivalent of .Net's Automapper?

Checkout the Dozer project.
Dozer supports simple property mapping, complex type mapping, bi-directional mapping, implicit-explicit mapping, as well as recursive mapping.
It makes use of BeanUtils and extends on it.

Check out my ModelMapper. It was inspired by AutoMapper, but adds a few new things such as intelligent mapping.
ModelMapper is an intelligent object
mapping framework that eliminates the
need to manually map objects to each
other. It uses a convention-based
approach to map objects while
providing a simple refactoring safe
API for handling specific mapping
scenarios.
http://modelmapper.org
Also a brief blog post from Jimmy Bogard, the creator of AutoMapper:
http://lostechies.com/jimmybogard/2012/09/17/automapper-for-java/

You should check the open source project Beanutils from Apache Commons.

Related

which database for java to store data in memory? [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 9 years ago.
I'm looking for a database which would allow me to store most of the objects in the memory. Basically I want to store in the memory everything except some rarely used data (history of changes, etc).
I'm looking for:
simple API for java, preferably non-ORM
ACID is not required (well, D is)
some support for queries, but nothing fancy
The idea is to operate on a model in memory, store any "command" mutating the model in the database, periodically synchronize model to database (like prevayler does)
Which database matches my needs? (I'll use postgres or H2 if there isn't anything simpler).
You need one of object databases: http://en.wikipedia.org/wiki/Comparison_of_object_database_management_systems
You should use Terracotta. It is usually used for caching, but its exactly what you are asking for, except that it's "querying" abilities are sparse.
Update:
The previous link was to their "enterprise" edition, but they have the open source project Ehcache which fits your needs, and their enterprise product is based on.

Abstraction, an OOPs vs non-OOPs concept [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 9 years ago.
I am reading OOPS concepts and got stuck on Abstraction. I am not able to fully understand the concept. As I am feeling that it doesn't belongs to OOPS only. It was also used in C. But how
java abstraction different from C language abstraction. I know it is not a good question
for this forum but i am not able to get the perfect answer.
abstraction means to hide or to separate the complex details of one part of code to other part. say, you have to use a method that does complex calculation, and gives some result. So instead of writing your method inline, its better to write it in a method that just expose the signature (params and return type). in that way your caller (of method) remains unaware of complex code behind the method.
in general, when you use library function in c/c++ or APIs in java, it is also an abstraction.
So indeed, abstraction is not only OOP, but a general concept can be applied anywhere (even beyond the programming).

Taxonomy API in Java or Javascript [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
I was wondering if there is any api or library available that provides a taxonomy for a given term in jSON.
For instance, if the argument is Shoes, it should return a data structure consisting of all the synonmys or types of shoes like Boots, Flip-flops, Slippers, Stilettos, and so on..
Thanks :)
Your best bet is to use the Java API for WordNet
http://lyle.smu.edu/~tspell/jaws/index.html
You can wrap this inside a servlet and call it via jquery in your application.
JSON is not typed by itself, you have to use another notation to add type to the data encoded in JSON. JSON-LD for example allows to add the concepts of linked data/semantic web to the json data. Using this information it is possible to query the taxonomy that defines the structure of the data.

what aspects should i keep in mind while developing a Java based API [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
I am experiencing the pain of developing an API based on (Selenium2) Webdriver and here is my dilemma.
I have basically 4 packages:
com.example.qa.pageobject
com.exmaple.qa.setup
com.example.qa.test
com.example.qa.utils
In com.example.qa.test, i have test classes that "USE" classes from other packages.
I am ending up in the following test method.
#Test
public void testScenario16786() {
Login login = new Login();
login.setUp();
AddSingleDomain asd = new AddSingleDomain();
asd.addSingleDomain();
AddARecord ar = new AddARecord();
ar.AddARecordTest();
}
Now, this seems to be a very bad example of developing in Java, which almost seems procedural. Is there any other way of doing it ? Are there some RULES that i need to be aware of while designing an API, which will be used by others ? i am sure that this is somewhat of a classical problem and has been solved before, i just want to know what are the many ways of resolving this, like:
One resolution, could be to use Factory Pattern, and based on a key, a specific class is instantiated, which is good but is there a more elegant way ?
Your test class is necessarily procedural - a repeatable set of steps, that's fine.
The commonly recommended approach is to use the Page Object pattern and selenium also provides a PageFactory object to help you (see end of the page):
page objects
You might find the presentation "How to Design a Good API & Why it Matters" by Joshua Bloch to be helpful.

Pros and Cons of using regex in Java [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 11 years ago.
Can someone list comprehensive list the pros and cons of using regular expressions in Java programing?
Pro: when regular expressions do what you need.
Con: when they don't.
Other than that, the question as stated is mostly ideological.
Pros:
They are an effective way to match against input.
They are easily configurable and can be separated from code.
Cons:
They be hard to read.
They are not performant. If performance is a concern do not use them.
Pro: It works and it's simple.
Con: There are none.
Why ask? Perhaps you have something more specific you'd like to know?

Categories

Resources