Какова идеальная панель инструментов для МН разработки / разработки SQL?

Следующий отрывок является методом теста Junit 4 с зеленым светом:

@Test
public void testUnmarshallFromParentToChild() throws JAXBException {
  Person person = new Person();
  int age = 30;
  String name = "Foo";
  person.name = name;
  person.age= age;

  // Marshalling
  JAXBContext context = JAXBContext.newInstance(person.getClass());
  Marshaller marshaller = context.createMarshaller();

  StringWriter writer = new StringWriter();
  marshaller.marshal(person, writer);

  String outString = writer.toString();

  assertTrue(outString.contains("</person"));

  // Unmarshalling
  context = JAXBContext.newInstance(Person.class, RecieverPerson.class);
  Unmarshaller unmarshaller = context.createUnmarshaller();
  StringReader reader = new StringReader(outString);
  RecieverPerson reciever = (RecieverPerson)unmarshaller.unmarshal(reader);

  assertEquals(name, reciever.name);
  assertEquals(age, reciever.age);
}

важная часть является использованием JAXBContext.newInstance(Class... classesToBeBound) метод для контекста немаршалинга:

 context = JAXBContext.newInstance(Person.class, RecieverPerson.class);

С этим вызовом, JAXB вычислит ссылочное закрытие на определенных классах и распознает RecieverPerson. Тестовые передачи. И если Вы измените порядок параметров, то Вы доберетесь java.lang.ClassCastException (таким образом, они будут должны быть переданными в этом порядке).

7
задан skaffman 30 September 2009 в 07:59
поделиться

5 ответов

Being an old-fashioned sort of chap I still mainly get along with SQL*Plus and the TextPad IDE. TextPad is nagware, but the licence is cheap and the tool has some fantastic features. Also people have written PLSQL syntax libraries for it, which give you keyword highlighting. It is also possible to hook TextPad into other desktop tools such as Subversion.

SQL^Developer is written in java, which means it is a voracious consumer of memory. Still there is undoubted merit in having a data browser. Also the upcoming version 2.1 features built-in unit test, which could be very tasty.

Useful utilities:

  • pldoc :: generate Javadoc-style documentation from the comments in your package spec
  • utplplsql :: unit test harness; old but it still works
  • QUTO :: another, more sophisticated unit test harness (which I don't use for the same reason I'm still hacking with SQL*Plus and TextPad)
  • QGCU :: PL/SQL code generator (previously QNXO)

In defence of Luddism

The danger with tools like TOAD and SQL*Developer is that they allow us to execute DML and DDL directly against the database, including editing PL/SQL source. This is fine and dandy and awfully in the spirit of Getting Things Done. Until we need to revert our changes. Or the production DBA demands a script....

Of course it is possible to use TOAD or SQL Developer in a safe fashion - I know SQL Developer can hook into source control as well - if just requires more self-discipline.

8
ответ дан 6 December 2019 в 10:51
поделиться

I always liked the PL/SQL Developer by Allround Automations - an excellent, quick and easy to use, and totally affordable tool!

For an interactive query shell - much better than SQL*Plus - I used to use "Golden" - a nice and powerful shareware tool, highly recommended.

Much better than anything else I ever tried with Oracle.

Marc

7
ответ дан 6 December 2019 в 10:51
поделиться

Might be a slightly different answer than you were expecting but I feel the Oracle documentation and in particular this book should be essential for any PL/SQL toolbox.

1
ответ дан 6 December 2019 в 10:51
поделиться

Мой основной редактор пакетов PL / SQL - SlickEdit. SlickEdit предлагает хорошую поддержку для разработки PL / SQL, хотя вы можете пропустить прямое подключение к базе данных, которое предлагают такие инструменты, как TOAD или SQLDeveloper. С другой стороны, работа с файлами PL / SQL (вместо непосредственной работы с объектами базы данных, как это делают многие пользователи TOAD) является хорошей практикой IMO для любого нетривиального проекта. В дополнение к SlickEdit я использую несколько самодельных вспомогательных программ, например, одну, которая загружает исходный код из базы данных и создает исходный файл, а другая - компилирует исходный код и вычисляет правильные номера строк для ошибок в файле, содержащем составные объекты, например, как спецификация пакета, так и тело.

Для прямого доступа к базе данных я предпочитаю SQLDeveloper, в основном потому, что он бесплатный и хорошо работает в Linux.

1
ответ дан 6 December 2019 в 10:51
поделиться

Я использую:

  • Eclipse в качестве IDE
  • Редактор PLSQL Тоби в качестве плагина PLSQL Eclipse
  • TOAD в качестве инструмента базы данных
  • utplsql и OUnit в качестве среды модульного тестирования
  • Ant как инструмент сборки
  • CVS как инструмент управления версиями
  • pldoc как инструмент документации
  • CruiseControl как инструмент непрерывной интеграции

Редактор PLSQL Тоби может:

  • Подсветка синтаксиса
  • Завершение кода
  • Загрузить в базу данных
  • Генерация заголовка
  • F3 переход к коду
1
ответ дан 6 December 2019 в 10:51
поделиться
Другие вопросы по тегам:

Похожие вопросы: